Skip to content

Commit

Permalink
fix(head): update connect-src directive
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesrocket committed Mar 18, 2024
1 parent 0ade950 commit ddc946f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion templates/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<meta name="base" content="{{ config.base_url | safe }}"/>
<meta name="referrer" content="strict-origin-when-cross-origin"/>
{% if config.extra.csp == true %}{% block csp %}
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; font-src 'self'; img-src 'self' {% if page.extra.image %}{% if page.extra.image is matching("^http[s]?://") %}{{ page.extra.image }}{% endif %}{% endif %} {% if config.extra.images.home is matching("^http[s]?://") %}{{ config.extra.images.home }}{% endif %} {% if config.extra.images.post_list is matching("^http[s]?://") %}{{ config.extra.images.post_list }}{% endif %} {% if category_image_match %}{% if category_image_match is matching("^http[s]?://") %} {{ category_image }}{% endif %}{% endif %}{% if config.extra.images.default_post is matching("^http[s]?://") %} {{ config.extra.images.default_post }}{% endif %}{% if page.extra.csp_img %}{%for url in page.extra.csp_img %} {{ url }}{% endfor %}{% endif %}{% if section.extra.csp_img %}{%for url in section.extra.csp_img %} {{ url }}{% endfor %}{% endif %}; script-src 'self' {% if config.extra.comments.system == "giscus" %}giscus.app/client.js{% endif %}{% if config.extra.comments.system == "cactus" %} 'sha512-{{ cactus_hash | safe }}'{% endif %}; manifest-src 'self'; style-src 'self' {% if page_image_hash %}'sha512-{{ page_image_hash | safe }}'{% elif category_image %}'sha512-{{ category_image_hash |safe }}'{% else %}'sha512-{{ default_post_image_hash | safe }}'{% endif %} 'sha512-{{ main_images_hash | safe }}' {% if config.extra.comments.system == "giscus" %}giscus.app/default.css{% endif %}; media-src 'self'; frame-src 'self' https://player.vimeo.com/ https://www.youtube.com/ https://www.youtube-nocookie.com/ {% if config.extra.comments.system == "giscus" %}giscus.app{% endif %}; object-src 'none'; base-uri 'self'; form-action 'self'; connect-src {% if config.build_search_index == true %}http://127.0.0.1:1111/ {% endif %}{% if config.extra.comments.system == "cactus" %}https://matrix.cactus.chat/ {% endif %}{% if config.mode == "serve" %} ws://127.0.0.1:1024/livereload{% endif %}{% if config.mode != "serve" and config.extra.comments.system != "cactus" and config.extra.comments.system != "giscus" %}'none'{% endif %}">
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; font-src 'self'; img-src 'self' {% if page.extra.image %}{% if page.extra.image is matching("^http[s]?://") %}{{ page.extra.image }}{% endif %}{% endif %} {% if config.extra.images.home is matching("^http[s]?://") %}{{ config.extra.images.home }}{% endif %} {% if config.extra.images.post_list is matching("^http[s]?://") %}{{ config.extra.images.post_list }}{% endif %} {% if category_image_match %}{% if category_image_match is matching("^http[s]?://") %} {{ category_image }}{% endif %}{% endif %}{% if config.extra.images.default_post is matching("^http[s]?://") %} {{ config.extra.images.default_post }}{% endif %}{% if page.extra.csp_img %}{%for url in page.extra.csp_img %} {{ url }}{% endfor %}{% endif %}{% if section.extra.csp_img %}{%for url in section.extra.csp_img %} {{ url }}{% endfor %}{% endif %}; script-src 'self' {% if config.extra.comments.system == "giscus" %}giscus.app/client.js{% endif %}{% if config.extra.comments.system == "cactus" %} 'sha512-{{ cactus_hash | safe }}'{% endif %}; manifest-src 'self'; style-src 'self' {% if page_image_hash %}'sha512-{{ page_image_hash | safe }}'{% elif category_image %}'sha512-{{ category_image_hash |safe }}'{% else %}'sha512-{{ default_post_image_hash | safe }}'{% endif %} 'sha512-{{ main_images_hash | safe }}' {% if config.extra.comments.system == "giscus" %}giscus.app/default.css{% endif %}; media-src 'self'; frame-src 'self' https://player.vimeo.com/ https://www.youtube.com/ https://www.youtube-nocookie.com/ {% if config.extra.comments.system == "giscus" %}giscus.app{% endif %}; object-src 'none'; base-uri 'self'; form-action 'self'; connect-src {% if config.build_search_index == true %}{{ config.base_url }} {% endif %}{% if config.extra.comments.system == "cactus" %}https://matrix.cactus.chat/ {% endif %}{% if config.mode == "serve" %} ws://127.0.0.1:1024/livereload{% endif %}{% if config.mode != "serve" and config.extra.comments.system != "cactus" and config.extra.comments.system != "giscus" %}'none'{% endif %}">
{% endblock csp %}{% endif %}
<meta name="robots" content="index,follow">
<meta name="theme-color" content="#2C2D32"/>
Expand Down

0 comments on commit ddc946f

Please sign in to comment.