diff --git a/apps/pwa/tests.py b/apps/pwa/tests.py index 6c75a58..0f14d4a 100644 --- a/apps/pwa/tests.py +++ b/apps/pwa/tests.py @@ -59,5 +59,5 @@ def test_base_template_links_manifest_and_registers_service_worker(client, djang content = response.content.decode() assert 'rel="manifest"' in content - assert "serviceWorker" in content + assert "register-sw.js" in content assert "apple-touch-icon" in content diff --git a/config/settings/prod.py b/config/settings/prod.py index eeec3e1..3d5fda9 100644 --- a/config/settings/prod.py +++ b/config/settings/prod.py @@ -35,7 +35,12 @@ CONTENT_SECURITY_POLICY = { "DIRECTIVES": { "default-src": ["'self'"], "img-src": ["'self'", "https:", "data:"], - "style-src": ["'self'"], + # Tag pills render a per-tag color via a dynamic inline style="--tag- + # color: ..." attribute (templates/articles/_article_tags.html etc.), + # so style-src needs 'unsafe-inline'. script-src stays strict with no + # exception — every +