ServiceStack.HttpRequestExtensions.GetAbsolutePath C# (CSharp) Method

GetAbsolutePath() public static method

public static GetAbsolutePath ( this httpReq ) : string
httpReq this
return string
        public static string GetAbsolutePath(this IRequest httpReq)
        {
            var resolvedPathInfo = httpReq.PathInfo;

            var pos = httpReq.RawUrl.IndexOf(resolvedPathInfo, StringComparison.OrdinalIgnoreCase);
            if (pos == -1)
                throw new ArgumentException($"PathInfo '{resolvedPathInfo}' is not in Url '{httpReq.RawUrl}'");

            return httpReq.RawUrl.Substring(0, pos + resolvedPathInfo.Length);
        }