mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 15:42:48 -05:00
nginx preserve upstream header values, fix ip (#2847)
This commit is contained in:
@ -29,7 +29,6 @@ public static class CoreHelpers
|
||||
private static readonly DateTime _max = new DateTime(9999, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
||||
private static readonly Random _random = new Random();
|
||||
private static readonly string CloudFlareConnectingIp = "CF-Connecting-IP";
|
||||
private static readonly string RealIp = "X-Real-IP";
|
||||
|
||||
/// <summary>
|
||||
/// Generate sequential Guid for Sql Server.
|
||||
@ -560,10 +559,6 @@ public static class CoreHelpers
|
||||
{
|
||||
return httpContext.Request.Headers[CloudFlareConnectingIp].ToString();
|
||||
}
|
||||
if (globalSettings.SelfHosted && httpContext.Request.Headers.ContainsKey(RealIp))
|
||||
{
|
||||
return httpContext.Request.Headers[RealIp].ToString();
|
||||
}
|
||||
|
||||
return httpContext.Connection?.RemoteIpAddress?.ToString();
|
||||
}
|
||||
|
Reference in New Issue
Block a user