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
+3 -2
View File
@@ -226,8 +226,9 @@ def test_one_view(logged_in_client, url, expected, event, item, item_category, o
assert response.status_code == expected
# Do not reintroduce any CSP nonces into control responses, as discussed in PR #6387
assert 'script-src' in response['Content-Security-Policy']
assert 'nonce-' not in response['Content-Security-Policy']
if response['Content-Type'] != 'application/json':
assert 'script-src' in response['Content-Security-Policy']
assert 'nonce-' not in response['Content-Security-Policy']
@pytest.mark.parametrize('url', [