* AB4951 - Move routing files to abstractions * Changed UriUtility from static to instance * Moved more files from Routing in web to Abstractions * Moved UrlProvider to Abstractions * Moved PublishedRequest to Abstractions
18 lines
485 B
C#
18 lines
485 B
C#
using System.Web;
|
|
using Umbraco.Core;
|
|
using Umbraco.Net;
|
|
|
|
namespace Umbraco.Web
|
|
{
|
|
internal class AspNetIpResolver : IIpResolver
|
|
{
|
|
public string GetCurrentRequestIpAddress()
|
|
{
|
|
var httpContext = HttpContext.Current is null ? null : new HttpContextWrapper(HttpContext.Current);
|
|
var ip = httpContext.GetCurrentRequestIpAddress();
|
|
if (ip.ToLowerInvariant().StartsWith("unknown")) ip = "";
|
|
return ip;
|
|
}
|
|
}
|
|
}
|