From 06ea48d0be6955e63fcee6294fdfb7bd40f3c2ec Mon Sep 17 00:00:00 2001 From: Shad Storhaug Date: Wed, 12 Mar 2014 02:38:48 +0700 Subject: [PATCH] Fixed the SiteMapNode.ResolveUrl method so it won't cache when the protocol is *. --- src/MvcSiteMapProvider/MvcSiteMapProvider/SiteMapNode.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/MvcSiteMapProvider/MvcSiteMapProvider/SiteMapNode.cs b/src/MvcSiteMapProvider/MvcSiteMapProvider/SiteMapNode.cs index 59182f70..3640cc9b 100644 --- a/src/MvcSiteMapProvider/MvcSiteMapProvider/SiteMapNode.cs +++ b/src/MvcSiteMapProvider/MvcSiteMapProvider/SiteMapNode.cs @@ -389,13 +389,14 @@ public override string Url /// public override void ResolveUrl() { - var IsHostNameFromRequest = !string.IsNullOrEmpty(this.Protocol) && string.IsNullOrEmpty(this.HostName); + var isProtocolOrHostNameFromRequest = + (!string.IsNullOrEmpty(this.Protocol) && (string.IsNullOrEmpty(this.HostName) || this.Protocol == "*")); // NOTE: In all cases where values from the current request can be included in the URL, // we need to disable URL resolution caching. if (this.CacheResolvedUrl && string.IsNullOrEmpty(this.UnresolvedUrl) && this.preservedRouteParameters.Count == 0 && !this.IncludeAmbientValuesInUrl && - !IsHostNameFromRequest) + !isProtocolOrHostNameFromRequest) { this.resolvedUrl = this.GetResolvedUrl(); }