private static UrlParts CreateForAbsolutePath(IServerUtility serverUtility, Uri uri) { var host = uri.AbsoluteUri.Substring(0, uri.AbsoluteUri.Length - uri.PathAndQuery.Length); var parts = new UrlParts(serverUtility, host); foreach (var segment in uri.Segments) { parts.AppendPath(segment); } parts.ConvertPathInfoToDict(); parts.SetQueryString(uri.Query); return(parts); }
public void InsertFrontPath_ShouldHandleTwoPathsWithSlash() { UrlParts builder = new UrlParts(); builder.AppendPath("/something"); builder.InsertFrontPath("http://something/else/"); Assert.AreEqual("http://something/else/something", builder.BuildPath()); }
private static UrlParts CreateForAbsolutePath(Uri uri) { string host = uri.AbsoluteUri.Substring(0, uri.AbsoluteUri.Length - uri.PathAndQuery.Length); UrlParts parts = new UrlParts(host); foreach (string segment in uri.Segments) { parts.AppendPath(segment); } parts.ConvertPathInfoToDict(); parts.SetQueryString(uri.Query); return parts; }
private static UrlParts CreateForAbsolutePath(IServerUtility serverUtility, Uri uri) { var host = uri.AbsoluteUri.Substring(0, uri.AbsoluteUri.Length - uri.PathAndQuery.Length); var parts = new UrlParts(serverUtility, host); foreach (var segment in uri.Segments) { parts.AppendPath(segment); } parts.ConvertPathInfoToDict(); parts.SetQueryString(uri.Query); return parts; }