Skip to content

Commit

Permalink
🔒️ fix: prevent malformed CSP header
Browse files Browse the repository at this point in the history
  • Loading branch information
welpo committed Feb 23, 2023
1 parent 5dcd605 commit 54ae781
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions templates/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,14 @@

<meta http-equiv="Content-Security-Policy"
content="default-src 'self'
{% if config.extra.allowed_domains %}
{%- if config.extra.allowed_domains -%}
;
{%- for domain in config.extra.allowed_domains -%}
{{ domain.directive }} {{ domain.domains | join(sep=' ') }};
{{ domain.directive }} {{ domain.domains | join(sep=' ') }}
{%- if not loop.last -%}
;
{%- endif -%}
{%- endfor -%}
{% endif %}">
{%- endif -%}">

</head>

0 comments on commit 54ae781

Please sign in to comment.