mirror of
https://github.com/bitwarden/server.git
synced 2025-07-16 07:07:32 -05:00
Changing CF-Connecting-IP -> X-Connecting-IP. Also renaming CloudFlareConnectingIp. (#3236)
This commit is contained in:
@ -29,7 +29,7 @@ public static class CoreHelpers
|
||||
private static readonly DateTime _epoc = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
||||
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 RealConnectingIp = "X-Connecting-IP";
|
||||
|
||||
/// <summary>
|
||||
/// Generate sequential Guid for Sql Server.
|
||||
@ -557,9 +557,9 @@ public static class CoreHelpers
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!globalSettings.SelfHosted && httpContext.Request.Headers.ContainsKey(CloudFlareConnectingIp))
|
||||
if (!globalSettings.SelfHosted && httpContext.Request.Headers.ContainsKey(RealConnectingIp))
|
||||
{
|
||||
return httpContext.Request.Headers[CloudFlareConnectingIp].ToString();
|
||||
return httpContext.Request.Headers[RealConnectingIp].ToString();
|
||||
}
|
||||
|
||||
return httpContext.Connection?.RemoteIpAddress?.ToString();
|
||||
|
Reference in New Issue
Block a user