Fixed: Real IP logging when IPv4 is mapped as IPv6

This commit is contained in:
Robin Dadswell
2021-05-29 19:38:49 +01:00
committed by Qstick
parent 934e4f2814
commit 7711f5a407
@@ -120,6 +120,12 @@ namespace Prowlarr.Http.Extensions
}
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