From 06c9d57c1adb8274855eccb9eb1d564ad605a9ed Mon Sep 17 00:00:00 2001 From: Sebastian Date: Tue, 25 Oct 2016 22:39:53 +0200 Subject: [PATCH] Middleware fixed --- src/Squidex/Pipeline/SingleUrlsMiddleware.cs | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/Squidex/Pipeline/SingleUrlsMiddleware.cs b/src/Squidex/Pipeline/SingleUrlsMiddleware.cs index fc4c8caca..3e94018aa 100644 --- a/src/Squidex/Pipeline/SingleUrlsMiddleware.cs +++ b/src/Squidex/Pipeline/SingleUrlsMiddleware.cs @@ -30,20 +30,12 @@ namespace Squidex.Pipeline var currentUrl = string.Concat(context.Request.Scheme, "://", context.Request.Host, context.Request.Path); var hostName = context.Request.Host.ToString().ToLowerInvariant(); - if (hostName.StartsWith("www")) + if (hostName.StartsWith("www.")) { - hostName = hostName.Substring(3); + hostName = hostName.Substring(4); } - - var requestPath = context.Request.Path.ToString(); - - if (!requestPath.EndsWith("/") && - !requestPath.Contains(".")) - { - requestPath = requestPath + "/"; - } - - var newUrl = string.Concat("https://", hostName, requestPath); + + var newUrl = string.Concat("https://", hostName, context.Request.Path); if (!string.Equals(newUrl, currentUrl, StringComparison.OrdinalIgnoreCase)) {