From 49f727b242f816cddc4a01b72d2bd36ad4af8c0e Mon Sep 17 00:00:00 2001 From: Shad Storhaug Date: Thu, 15 Oct 2015 23:04:35 +0700 Subject: [PATCH] Patch for one issue in #412 - the CreateHttpContext(ISiteMapNode, Uri, TextWriter) overload was incorrectly adding the query string with the ? separator, which was interpreted by the QueryString dictionary as being part of the first key. --- .../MvcSiteMapProvider/Web/Mvc/MvcContextFactory.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/MvcSiteMapProvider/MvcSiteMapProvider/Web/Mvc/MvcContextFactory.cs b/src/MvcSiteMapProvider/MvcSiteMapProvider/Web/Mvc/MvcContextFactory.cs index 9914eac6..788b22c1 100644 --- a/src/MvcSiteMapProvider/MvcSiteMapProvider/Web/Mvc/MvcContextFactory.cs +++ b/src/MvcSiteMapProvider/MvcSiteMapProvider/Web/Mvc/MvcContextFactory.cs @@ -36,7 +36,10 @@ public virtual HttpContextBase CreateHttpContext(ISiteMapNode node, Uri uri, Tex if (writer == null) throw new ArgumentNullException("writer"); - var request = new HttpRequest(string.Empty, uri.ToString(), uri.Query); + var request = new HttpRequest( + filename: string.Empty, + url: uri.ToString(), + queryString: string.IsNullOrEmpty(uri.Query) ? string.Empty : uri.Query.Substring(1)); var response = new HttpResponse(writer); var httpContext = new HttpContext(request, response); return new SiteMapHttpContext(httpContext, node);