Closed fritzmg closed 1 year ago
This introduces an additional fromHeader factory method to the CSPBuilder with which you can parse and then modify an existing Content-Security-Policy response header.
fromHeader
CSPBuilder
$csp = CSPBuilder::fromHeader("script-src 'self'"); $csp->addSource('style-src', 'self'); echo $csp->compile(); // script-src 'self'; style-src 'self'
This can be useful if the CSP header is defined elsewhere in the system and you want to additionally analyse or modify said header.
Thanks! This is a wonderful addition to this library.
Nice :). @paragonie-security will you tag this as 2.10.0?
2.10.0
@paragonie-security any chance of this getting tagged as a new release?
This introduces an additional
fromHeader
factory method to theCSPBuilder
with which you can parse and then modify an existing Content-Security-Policy response header.This can be useful if the CSP header is defined elsewhere in the system and you want to additionally analyse or modify said header.