Re: PHP & Content-Security-Policy

From: Date: Fri, 17 Sep 2021 09:13:10 +0000
Subject: Re: PHP & Content-Security-Policy
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-327707@lists.php.net to get a copy of this message
On 17/09/2021 09:10, gordonisnz@gmail.com wrote:
php-general@lists.php.net 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

« previous php.general (#327707) next »