Fixes the custom RequestCultureProvider to dynamically add cultures to the supported cultures list, changes the request/builder to not reference a ICultureInfo and instead just a string to avoid allocations and confusion since the handlers will end up as a string anyways. Removes the unnecessary cultureinfo concurrentdictionary because CultureInfo.GetCultureInfo does the same thing.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.Extensions.Options;
|
||||
@@ -112,10 +112,10 @@ namespace Umbraco.Web.Routing
|
||||
// if the property varies, get the variant value, URL is "<domain>/<variant-alias>"
|
||||
|
||||
// but! only if the culture is published, else ignore
|
||||
if (varies && !node.HasCulture(domainUri.Culture.Name)) continue;
|
||||
if (varies && !node.HasCulture(domainUri.Culture)) continue;
|
||||
|
||||
var umbracoUrlName = varies
|
||||
? node.Value<string>(_publishedValueFallback,Constants.Conventions.Content.UrlAlias, culture: domainUri.Culture.Name)
|
||||
? node.Value<string>(_publishedValueFallback,Constants.Conventions.Content.UrlAlias, culture: domainUri.Culture)
|
||||
: node.Value<string>(_publishedValueFallback, Constants.Conventions.Content.UrlAlias);
|
||||
|
||||
var aliases = umbracoUrlName?.Split(new [] {','}, StringSplitOptions.RemoveEmptyEntries);
|
||||
@@ -127,7 +127,7 @@ namespace Umbraco.Web.Routing
|
||||
{
|
||||
var path = "/" + alias;
|
||||
var uri = new Uri(CombinePaths(domainUri.Uri.GetLeftPart(UriPartial.Path), path));
|
||||
yield return UrlInfo.Url(_uriUtility.UriFromUmbraco(uri, _requestConfig).ToString(), domainUri.Culture.Name);
|
||||
yield return UrlInfo.Url(_uriUtility.UriFromUmbraco(uri, _requestConfig).ToString(), domainUri.Culture);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user