U4-1186 - bugfix previous commit
This commit is contained in:
@@ -51,9 +51,6 @@ namespace Umbraco.Web.Routing
|
||||
/// <returns>The domain and its normalized uri, that best matches the current uri, else the first domain (if <c>defaultToFirst</c> is <c>true</c>), else null.</returns>
|
||||
public static DomainAndUri DomainMatch(IEnumerable<Domain> domains, Uri current, bool defaultToFirst)
|
||||
{
|
||||
if (!domains.Any())
|
||||
return null;
|
||||
|
||||
// sanitize the list to have proper uris for comparison (scheme, path end with /)
|
||||
// we need to end with / because example.com/foo cannot match example.com/foobar
|
||||
// we need to order so example.com/foo matches before example.com/
|
||||
@@ -64,6 +61,9 @@ namespace Umbraco.Web.Routing
|
||||
.OrderByDescending(t => t.UriString)
|
||||
.Select(t => new DomainAndUri { Domain = t.Domain, Uri = new Uri(t.UriString) });
|
||||
|
||||
if (!domainsAndUris.Any())
|
||||
return null;
|
||||
|
||||
DomainAndUri domainAndUri;
|
||||
if (current == null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user