Skip to content

Commit

Permalink
Update Lombiq.HelpfulLibraries.AspNetCore/Security/CdnContentSecurity…
Browse files Browse the repository at this point in the history
…PolicyProvider.cs

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
sarahelsaig and coderabbitai[bot] authored Jan 6, 2024
1 parent 0d37c79 commit 5cf2a8d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ public ValueTask UpdateAsync(IDictionary<string, string> securityPolicies, HttpC
{
if (PermittedStyleSources.Any())
{
securityPolicies[StyleSrc] += " " + string.Join(' ', PermittedStyleSources.Select(uri => uri.Host));
securityPolicies[StyleSrc] = string.Join(' ', securityPolicies[StyleSrc].Split(' ').Union(PermittedStyleSources.Select(uri => uri.Host)).Distinct());
}

if (PermittedScriptSources.Any())
{
securityPolicies[ScriptSrc] += " " + string.Join(' ', PermittedScriptSources.Select(uri => uri.Host));
securityPolicies[ScriptSrc] = string.Join(' ', securityPolicies[ScriptSrc].Split(' ').Union(PermittedScriptSources.Select(uri => uri.Host)).Distinct());
}

return ValueTask.CompletedTask;
Expand Down

0 comments on commit 5cf2a8d

Please sign in to comment.