Closed (fixed)
Project:
Kint
Version:
2.1.1
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
13 Oct 2025 at 10:27 UTC
Updated:
7 Nov 2025 at 13:34 UTC
Jump to comment: Most recent
The kint PHP library supports adding nonces to its inline script through the AbstractRenderer::$js_nonce and AbstractRenderer::$css_nonce properties. We can add support for the csp module by filling these properties.
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
dieterholvoet commentedComment #4
jnvsor commentedHey Dieter, I noticed with your patch the nonce gets added ot the tags but drupal doesn't necessarily add the nonce to the header unless an event subscriber does it explicitly. This happens when csp_nonce is #attached but since kint echoes directly that's not an option.
I think there's no clean way to deal with this other than to add a nonce to every response with a csp header. Could you give this mr a once over and tell me if anything looks strange? Thanks
https://git.drupalcode.org/project/kint/-/merge_requests/10
Comment #5
dieterholvoet commentedGood catch! I commented in the MR.
Comment #6
jnvsor commentedThanks Dieter, released in 2.2.0