Don't check CSP on JSON responses

This commit is contained in:
luelista
2026-08-07 12:10:10 +02:00
committed by GitHub
parent dfd88e4007
commit d92f91c19e
+1
View File
@@ -226,6 +226,7 @@ def test_one_view(logged_in_client, url, expected, event, item, item_category, o
assert response.status_code == expected assert response.status_code == expected
# Do not reintroduce any CSP nonces into control responses, as discussed in PR #6387 # Do not reintroduce any CSP nonces into control responses, as discussed in PR #6387
if response['Content-Type'] != 'application/json':
assert 'script-src' in response['Content-Security-Policy'] assert 'script-src' in response['Content-Security-Policy']
assert 'nonce-' not in response['Content-Security-Policy'] assert 'nonce-' not in response['Content-Security-Policy']