Content Security Policy
Hi,
We have implemented custom CSP rule for our application. In CSP rule there is no option to implement prefetch-src as 'self' . Where should this be implemented ?
I have tried to implement it in response header and it gives me a warning as below:
The Content-Security-Policy directive 'prefetch-src' is implemented behind a flag which is currently disabled.
Also CSP headers are not a part of response on the login screen, and if CSP is added in response header will it be overridden by the CSP rule defined at application level once logged in. How can this be configured?
Regards,
Jill Haria
Hi Jill,
Below error can be seen when the browser doesn't recognize or not supported by default. Explore chrome://flags on your browser to find prefetch-src directive specific dependent flags and Enable it to check if error is observed. Resolving certain flags is up to the client's browser.
"The Content-Security-Policy directive 'prefetch-src' is implemented behind a flag which is currently disabled"
For the second part of your question,
Hi Jill,
Below error can be seen when the browser doesn't recognize or not supported by default. Explore chrome://flags on your browser to find prefetch-src directive specific dependent flags and Enable it to check if error is observed. Resolving certain flags is up to the client's browser.
"The Content-Security-Policy directive 'prefetch-src' is implemented behind a flag which is currently disabled"
For the second part of your question,
In order to make sure these headers are set,
CSP header can potentially get skipped if there is direct streaming enabled.
In order to get CSP header on all requests, you can disable direct streaming (via setting below). The performance may degrade slightly because of this.
please add the following setting:
Use Pega-Engine as the owning ruleset
purpose = prconfig/initialization/httpstreamduringassembly/default
value = false
Let me know if it helps!