Skip to content

Commit a7f23c3

Browse files
committed
fix: add CSP nonce for lite-youtube integration
1 parent 4ea50fc commit a7f23c3

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

templates/base_index.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@
6464
content="https://assets.ubuntu.com/v1/c17ef7b4-careers-meta-image-resized.png" />
6565
{% endif %}
6666

67+
<!--
68+
Pass the CSP nonce to lite-youtube so the <style> it injects into
69+
its shadow DOM is allowed by our nonce-based style-src directive.
70+
Must run before the deferred lite-youtube module upgrades the
71+
element.
72+
-->
73+
<script nonce="{{ csp_nonce }}">window.liteYouTubeNonce = "{{ csp_nonce }}";</script>
74+
6775
{% block extra_metatags %}{% endblock %}
6876

6977
<link rel="apple-touch-icon"

0 commit comments

Comments
 (0)