Skip to content

Commit

Permalink
Fixed the SiteMapNode.ResolveUrl method so it won't cache when the pr…
Browse files Browse the repository at this point in the history
…otocol is *.
  • Loading branch information
NightOwl888 committed Mar 11, 2014
1 parent 365390f commit 06ea48d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/MvcSiteMapProvider/MvcSiteMapProvider/SiteMapNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -389,13 +389,14 @@ public override string Url
/// </summary>
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();
}
Expand Down

0 comments on commit 06ea48d

Please sign in to comment.