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);
}