Append comments host in CSP

This commit is contained in:
daudix
2024-10-18 20:30:23 +03:00
parent 865c1d2839
commit 732217ccea
2 changed files with 9 additions and 3 deletions

View File

@ -18,6 +18,12 @@ content="default-src 'none';
{%- set connect_src = connect_src ~ " " ~ goatcounter_url -%}
{%- endif %}
{#- Append comments host if present -#}
{%- if config.extra.comments -%}
{%- set connect_src = connect_src ~ " " ~ "https://" ~ config.extra.comments.host -%}
{%- endif -%}
{#- Append WebSocket for Zola serve mode -#}
{%- if config.mode == "serve" -%}
{%- set connect_src = connect_src ~ " ws:" -%}