mirror of
https://github.com/Readarr/Readarr
synced 2026-01-01 05:03:13 +01:00
Fixed: Real IP logging when IPv4 is mapped as IPv6
This commit is contained in:
parent
ee81ad2add
commit
218a82998a
1 changed files with 6 additions and 0 deletions
|
|
@ -156,6 +156,12 @@ public static string GetRemoteIP(this HttpRequest request)
|
|||
}
|
||||
|
||||
var remoteIP = request.HttpContext.Connection.RemoteIpAddress;
|
||||
|
||||
if (remoteIP.IsIPv4MappedToIPv6)
|
||||
{
|
||||
remoteIP = remoteIP.MapToIPv4();
|
||||
}
|
||||
|
||||
var remoteAddress = remoteIP.ToString();
|
||||
|
||||
// Only check if forwarded by a local network reverse proxy
|
||||
|
|
|
|||
Loading…
Reference in a new issue