1
0
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:
Alexey Zilber
2023-08-29 21:25:47 +08:00
committed by GitHub
parent 626f7977d1
commit 776e454b79
4 changed files with 6 additions and 6 deletions

View File

@ -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();