mirror of
https://github.com/bitwarden/server
synced 2025-12-17 08:43:27 +00:00
Just use HttpContext RemoteIpAddress to get IP
This commit is contained in:
@@ -47,11 +47,6 @@ namespace Bit.Core
|
||||
return null;
|
||||
}
|
||||
|
||||
if(HttpContext.Request?.Headers?.TryGetValue("X-Forwarded-For", out StringValues forwardHeader) ?? false)
|
||||
{
|
||||
_ip = forwardHeader.FirstOrDefault()?.Trim();
|
||||
}
|
||||
|
||||
if(string.IsNullOrWhiteSpace(_ip))
|
||||
{
|
||||
_ip = HttpContext.Connection?.RemoteIpAddress?.ToString();
|
||||
|
||||
Reference in New Issue
Block a user