From b3c41e051fe49c948ca709da401b8efff4857899 Mon Sep 17 00:00:00 2001 From: Shannon Date: Thu, 10 Jul 2014 11:10:49 +1000 Subject: [PATCH] Fixes: U4-5199 Appending certain query strings to URLs cause InvalidOperationException (The UmbracoContext.Current is null) --- src/Umbraco.Core/UriExtensions.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Umbraco.Core/UriExtensions.cs b/src/Umbraco.Core/UriExtensions.cs index 430ba4b6d1..ff8419b796 100644 --- a/src/Umbraco.Core/UriExtensions.cs +++ b/src/Umbraco.Core/UriExtensions.cs @@ -134,7 +134,7 @@ namespace Umbraco.Core } /// - /// This is a performance tweak to check if this is a .css, .js or .ico, .jpg, .jpeg, .png, .gif file request since + /// This is a performance tweak to check if this not an ASP.Net server file /// .Net will pass these requests through to the module when in integrated mode. /// We want to ignore all of these requests immediately. /// @@ -142,10 +142,10 @@ namespace Umbraco.Core /// internal static bool IsClientSideRequest(this Uri url) { - // fixme - IsClientSideRequest should not use an hard-coded list of extensions - // a client-side request is anything that has an extension that is not .aspx? - var toIgnore = new[] { ".js", ".css", ".ico", ".png", ".jpg", ".jpeg", ".gif", ".html", ".svg" }; - return toIgnore.Any(x => Path.GetExtension(url.LocalPath).InvariantEquals(x)); + var ext = Path.GetExtension(url.LocalPath); + if (ext.IsNullOrWhiteSpace()) return false; + var toInclude = new[] { ".aspx", ".ashx", ".asmx", ".axd", ".svc" }; + return toInclude.Any(ext.InvariantEquals) == false; } ///