mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-19 21:46:50 -04:00
Fixed: Real IP logging when IPv4 is mapped as IPv6
(cherry picked from commit 782bdcc0a9c118f4b7a25fc90a966a6381a7f248)
This commit is contained in:
@@ -156,6 +156,12 @@ namespace Radarr.Http.Extensions
|
|||||||
}
|
}
|
||||||
|
|
||||||
var remoteIP = request.HttpContext.Connection.RemoteIpAddress;
|
var remoteIP = request.HttpContext.Connection.RemoteIpAddress;
|
||||||
|
|
||||||
|
if (remoteIP.IsIPv4MappedToIPv6)
|
||||||
|
{
|
||||||
|
remoteIP = remoteIP.MapToIPv4();
|
||||||
|
}
|
||||||
|
|
||||||
var remoteAddress = remoteIP.ToString();
|
var remoteAddress = remoteIP.ToString();
|
||||||
|
|
||||||
// Only check if forwarded by a local network reverse proxy
|
// Only check if forwarded by a local network reverse proxy
|
||||||
|
|||||||
Reference in New Issue
Block a user