Skip to content

Commit 48dcb79

Browse files
committed
Fixed bug with path not being decoded correctly
1 parent fb78ca9 commit 48dcb79

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Umbraco.Core/Routing/DomainUtilities.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System.Diagnostics.CodeAnalysis;
22
using System.Globalization;
3+
using System.Web;
34
using Umbraco.Cms.Core.PublishedCache;
45
using Umbraco.Cms.Core.Web;
56
using Umbraco.Extensions;
@@ -393,7 +394,10 @@ internal static bool ExistsDomainInPath(IEnumerable<Domain> domains, string path
393394
/// <returns>The path part relative to the uri of the domain.</returns>
394395
/// <remarks>Eg the relative part of <c>/foo/bar/nil</c> to domain <c>example.com/foo</c> is <c>/bar/nil</c>.</remarks>
395396
public static string PathRelativeToDomain(Uri domainUri, string path)
396-
=> path.Substring(domainUri.GetAbsolutePathDecoded().Length).EnsureStartsWith('/');
397+
{
398+
string decodedPath = HttpUtility.UrlDecode(path);
399+
return decodedPath.Substring(domainUri.GetAbsolutePathDecoded().Length).EnsureStartsWith('/');
400+
}
397401

398402
#endregion
399403
}

0 commit comments

Comments
 (0)