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:
Shannon
2021-01-11 13:39:09 +11:00
parent b801199e7c
commit bd4006c577
34 changed files with 168 additions and 123 deletions

View File

@@ -461,7 +461,7 @@ namespace Umbraco.Web.PublishedCache.NuCache
var domains = _serviceContext.DomainService.GetAll(true);
foreach (var domain in domains
.Where(x => x.RootContentId.HasValue && x.LanguageIsoCode.IsNullOrWhiteSpace() == false)
.Select(x => new Domain(x.Id, x.DomainName, x.RootContentId.Value, CultureInfo.GetCultureInfo(x.LanguageIsoCode), x.IsWildcard)))
.Select(x => new Domain(x.Id, x.DomainName, x.RootContentId.Value, x.LanguageIsoCode, x.IsWildcard)))
{
_domainStore.SetLocked(domain.Id, domain);
}
@@ -865,7 +865,7 @@ namespace Umbraco.Web.PublishedCache.NuCache
if (domain == null) continue;
if (domain.RootContentId.HasValue == false) continue; // anomaly
if (domain.LanguageIsoCode.IsNullOrWhiteSpace()) continue; // anomaly
var culture = CultureInfo.GetCultureInfo(domain.LanguageIsoCode);
var culture = domain.LanguageIsoCode;
_domainStore.SetLocked(domain.Id, new Domain(domain.Id, domain.DomainName, domain.RootContentId.Value, culture, domain.IsWildcard));
break;
}