[Bug 38365] Add Content-Security-Policy HTTP header to HTML responses
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38365 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #193951|0 |1 is obsolete| | --- Comment #287 from David Cook <dcook@prosentient.com.au> --- Created attachment 194579 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=194579&action=edit Bug 38365: Add script to insert CSP nonces into templates Add misc/devel/add_csp_nonces.pl which automatically adds CSP nonce attributes to inline <script> tags in Koha templates. The script: - Finds all .tt and .inc files in koha-tmpl/ - Adds nonce="[% Koha.CSPNonce | $raw %]" to inline scripts - Skips external scripts (those with src= attribute) - Skips scripts that already have nonce= attribute - Skips third-party library files in lib/ and vendor/ Usage: perl misc/devel/add_csp_nonces.pl # Dry run perl misc/devel/add_csp_nonces.pl --apply # Apply changes This script enables easy backporting of CSP nonce support to older Koha versions by running it against their template directories. Signed-off-by: David Cook <dcook@prosentient.com.au> Signed-off-by: Lari Taskula <lari.taskula@hypernova.fi> Signed-off-by: David Cook <dcook@prosentient.com.au> -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org