paragonie / csp-builder

Build Content-Security-Policy headers from a JSON file (or build them programmatically)
https://paragonie.com/projects
MIT License
544 stars 39 forks source link

Add method for retrieving value set for a directive #53

Closed bkosborne closed 3 years ago

bkosborne commented 3 years ago

The CSP builder has no method for retrieving the value that's currently set for directives. There's only a method to set the value for a directive. I have a scenario where I initialized the CSP builder from a large config array, and now I need to apply some selective additions to it, but need to get the value for some directives first.

bkosborne commented 3 years ago

Nevermind, I see now I can use the ->addSource method to do what I need