Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
		public void InsertFrontPath_ShouldHandleTwoPathsWithSlash()
		{
			UrlParts builder = new UrlParts();
			builder.AppendPath("/something");

			builder.InsertFrontPath("http://something/else/");

			Assert.AreEqual("http://something/else/something", builder.BuildPath());
		}
Exemplo n.º 3
0
		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;
		}
Exemplo n.º 4
0
		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;
		}