mirror of
https://github.com/Caraxi/mare.server.git
synced 2026-02-11 06:14:35 +01:00
add header x-forwarded-for
This commit is contained in:
parent
dbaf45ba70
commit
1bd37ffe70
1 changed files with 5 additions and 0 deletions
|
|
@ -10,6 +10,11 @@ namespace MareSynchronosServer
|
||||||
if (!string.IsNullOrEmpty(accessor.HttpContext.Request.Headers["CF-CONNECTING-IP"]))
|
if (!string.IsNullOrEmpty(accessor.HttpContext.Request.Headers["CF-CONNECTING-IP"]))
|
||||||
return 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");
|
var ipAddress = accessor.HttpContext.GetServerVariable("HTTP_X_FORWARDED_FOR");
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(ipAddress))
|
if (!string.IsNullOrEmpty(ipAddress))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue