diff --git a/src/Umbraco.Core/UriExtensions.cs b/src/Umbraco.Core/UriExtensions.cs index 96e24e89db..3ba004a939 100644 --- a/src/Umbraco.Core/UriExtensions.cs +++ b/src/Umbraco.Core/UriExtensions.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.IO; using System.Linq; using Umbraco.Core.Composing; @@ -137,6 +138,14 @@ namespace Umbraco.Core return false; } + /// + /// Non Client Side request Extensions + /// + internal readonly static HashSet NonClientSideRequestExtensions = new (5, StringComparer.InvariantCultureIgnoreCase) + { + ".aspx", ".ashx", ".asmx", ".axd", ".svc" + }; + /// /// 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. @@ -150,8 +159,7 @@ namespace Umbraco.Core { 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; + return !NonClientSideRequestExtensions.Contains(ext); } catch (ArgumentException) {