pass x-forwarded-for to properly log proxied login/logout
This commit is contained in:
parent
8b06da5783
commit
e2116712e7
@ -125,7 +125,9 @@ namespace WebfrontCore.Controllers.API
|
|||||||
Origin = privilegedClient,
|
Origin = privilegedClient,
|
||||||
Type = GameEvent.EventType.Login,
|
Type = GameEvent.EventType.Login,
|
||||||
Owner = Manager.GetServers().First(),
|
Owner = Manager.GetServers().First(),
|
||||||
Data = HttpContext.Connection.RemoteIpAddress.ToString()
|
Data = HttpContext.Request.Headers.ContainsKey("X-Forwarded-For")
|
||||||
|
? HttpContext.Request.Headers["X-Forwarded-For"].ToString()
|
||||||
|
: HttpContext.Connection.RemoteIpAddress.ToString()
|
||||||
});
|
});
|
||||||
|
|
||||||
return Ok();
|
return Ok();
|
||||||
@ -152,7 +154,9 @@ namespace WebfrontCore.Controllers.API
|
|||||||
Origin = Client,
|
Origin = Client,
|
||||||
Type = GameEvent.EventType.Logout,
|
Type = GameEvent.EventType.Logout,
|
||||||
Owner = Manager.GetServers().First(),
|
Owner = Manager.GetServers().First(),
|
||||||
Data = HttpContext.Connection.RemoteIpAddress.ToString()
|
Data = HttpContext.Request.Headers.ContainsKey("X-Forwarded-For")
|
||||||
|
? HttpContext.Request.Headers["X-Forwarded-For"].ToString()
|
||||||
|
: HttpContext.Connection.RemoteIpAddress.ToString()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ using System;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Security.Claims;
|
using System.Security.Claims;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
|
|
||||||
namespace WebfrontCore.Controllers
|
namespace WebfrontCore.Controllers
|
||||||
{
|
{
|
||||||
@ -57,7 +58,9 @@ namespace WebfrontCore.Controllers
|
|||||||
Origin = privilegedClient,
|
Origin = privilegedClient,
|
||||||
Type = GameEvent.EventType.Login,
|
Type = GameEvent.EventType.Login,
|
||||||
Owner = Manager.GetServers().First(),
|
Owner = Manager.GetServers().First(),
|
||||||
Data = HttpContext.Connection.RemoteIpAddress.ToString()
|
Data = HttpContext.Request.Headers.ContainsKey("X-Forwarded-For")
|
||||||
|
? HttpContext.Request.Headers["X-Forwarded-For"].ToString()
|
||||||
|
: HttpContext.Connection.RemoteIpAddress.ToString()
|
||||||
});
|
});
|
||||||
|
|
||||||
return Ok();
|
return Ok();
|
||||||
@ -82,7 +85,9 @@ namespace WebfrontCore.Controllers
|
|||||||
Origin = Client,
|
Origin = Client,
|
||||||
Type = GameEvent.EventType.Logout,
|
Type = GameEvent.EventType.Logout,
|
||||||
Owner = Manager.GetServers().First(),
|
Owner = Manager.GetServers().First(),
|
||||||
Data = HttpContext.Connection.RemoteIpAddress.ToString()
|
Data = HttpContext.Request.Headers.ContainsKey("X-Forwarded-For")
|
||||||
|
? HttpContext.Request.Headers["X-Forwarded-For"].ToString()
|
||||||
|
: HttpContext.Connection.RemoteIpAddress.ToString()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user