If httpContext.GetCurrentRequestIpAddress is called with a spoofed HTTP context then IP returns null
This commit is contained in:
committed by
Sebastiaan Janssen
parent
9829d4abef
commit
8af1e2bcf3
@@ -68,7 +68,7 @@ namespace Umbraco.Core.Compose
|
||||
{
|
||||
var httpContext = HttpContext.Current == null ? (HttpContextBase) null : new HttpContextWrapper(HttpContext.Current);
|
||||
var ip = httpContext.GetCurrentRequestIpAddress();
|
||||
if (ip.ToLowerInvariant().StartsWith("unknown")) ip = "";
|
||||
if (ip == null || ip.ToLowerInvariant().StartsWith("unknown")) ip = "";
|
||||
return ip;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user