Re: PHP & Content-Security-Policy
[email protected] (Ashley Sheridan)
| Newsgroups | php.general |
|---|---|
| Message-ID | <[email protected]> |
On 17/09/2021 09:10, [email protected] wrote: > [email protected] > > Hello. Has anyone got a good tutorial on how to use the > Content-Security-Policy and php example codes ? > > I've got 1 code on - but its blocked my own javascript from working :( > > i've played with it & now have javascript going - However my google > maps doesn't work. > > The map displays - but if you right-click, it should activate another > PHP script & display information - THAt part isn't going & its not > opening up the other php script. > > The tutorials ive found only have 1-line examples - but no > combinations of examples. > > Do I use them in separate lines ? or in one line ? > > Example of what i have (blocks my own javascript): > header("Content-Security-Policy: default-src 'none'"); > header("Content-Security-Policy: script-src 'self'"); > You can specify multiple items, but it all needs to be contained within a single header, see https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP for some examples. -- Ashley Sheridan https://www.ashleysheridan.co.uk