add header x-forwarded-for

This commit is contained in:
Stanley Dimant
2022-08-15 18:57:11 +02:00
parent dbaf45ba70
commit 1bd37ffe70

View File

@@ -10,6 +10,11 @@ namespace MareSynchronosServer
if (!string.IsNullOrEmpty(accessor.HttpContext.Request.Headers["CF-CONNECTING-IP"]))
return accessor.HttpContext.Request.Headers["CF-CONNECTING-IP"];
if (!string.IsNullOrEmpty(accessor.HttpContext.Request.Headers["X-Forwarded-For"]))
{
return accessor.HttpContext.Request.Headers["X-Forwarded-For"];
}
var ipAddress = accessor.HttpContext.GetServerVariable("HTTP_X_FORWARDED_FOR");
if (!string.IsNullOrEmpty(ipAddress))