Fixed: Real IP logging when IPv4 is mapped as IPv6

pull/1064/head
Robin Dadswell 4 years ago committed by ta264
parent ee81ad2add
commit 218a82998a

@ -156,6 +156,12 @@ namespace Readarr.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

Loading…
Cancel
Save