mirror of
https://github.com/welpo/tabi.git
synced 2025-10-11 07:46:15 +02:00
✨ feat(csp): add webmention support to content security policy
- include webmention.io in connect-src when webmention system is enabled - ensure compatibility with webmention services by updating CSP directives
This commit is contained in:
parent
4f6b64129a
commit
a663de6dac
1 changed files with 6 additions and 0 deletions
|
@ -54,6 +54,12 @@ content="default-src 'self'
|
|||
{%- set script_src = script_src ~ " " ~ " cdn.jsdelivr.net" -%}
|
||||
{%- endif -%}
|
||||
|
||||
{#- Check if a webmention system is enabled to allow the necessary domains and directives -#}
|
||||
{%- set webmention_enabled = config.extra.webmentions.enabled -%}
|
||||
{%- if webmention_enabled -%}
|
||||
{%- set connect_src = connect_src ~ " webmention.io" -%}
|
||||
{%- endif -%}
|
||||
|
||||
{#- Append WebSocket for Zola serve mode -#}
|
||||
{%- if config.mode == "serve" -%}
|
||||
{%- set connect_src = connect_src ~ " ws:" -%}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue