You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Local connections to an aspnetcore app running on win10 have the HttpContext.Connection.RemoteIpAddress property set to ::ffff:127.0.0.1.
The IPAddress.IsLoopBack() method returns false for this address - the method checks for IPv6 and IPv4 loopback addresses but doesn't check a loopback IPv4 address mapped to IPv6. I believe this is confusing.
The text was updated successfully, but these errors were encountered:
oliverholliday
changed the title
IPAddress.IsLoopBack returns false for ::ffff:127.0.0.1
IPAddress.IsLoopBack returns false for ::ffff:127.0.0.1
Feb 20, 2019
Local connections to an aspnetcore app running on win10 have the
HttpContext.Connection.RemoteIpAddress
property set to::ffff:127.0.0.1
.The
IPAddress.IsLoopBack()
method returns false for this address - the method checks for IPv6 and IPv4 loopback addresses but doesn't check a loopback IPv4 address mapped to IPv6. I believe this is confusing.https://github.com/dotnet/corefx/blob/master/src/System.Net.Primitives/src/System/Net/IPAddress.cs#L418
I worked around this by doing:
The text was updated successfully, but these errors were encountered: