Fix Display app on website root feature

This commit is contained in:
nicolas.dorier 2021-08-13 15:50:26 +09:00
parent a20906bc12
commit 77d1580ee3
No known key found for this signature in database
GPG Key ID: 6618763EF09186FE

View File

@ -30,9 +30,9 @@ namespace BTCPayServer.Filters
return true;
var settingsRepository = context.RouteContext.HttpContext.RequestServices.GetService<ISettingsRepository>();
var policies = settingsRepository.GetPolicies().GetAwaiter().GetResult();
if (policies?.DomainToAppMapping is { } mapping && mapping.Any())
if (policies?.DomainToAppMapping is { } mapping)
{
var matchedDomainMapping = policies.DomainToAppMapping.FirstOrDefault(item =>
var matchedDomainMapping = mapping.FirstOrDefault(item =>
item.Domain.Equals(context.RouteContext.HttpContext.Request.Host.Host, StringComparison.InvariantCultureIgnoreCase));
if (matchedDomainMapping != null)
{