Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should i set content security policy headers in ajax responses too in single page app?

I have single page app in which i only load index and every other request is ajax request.

Do i need to use CSP headers in those ajax responses or CSP is already enforced for everything after loading index ? So basically the only place i need to set content security policy headers is index?

like image 338
klonodo Avatar asked Oct 19 '25 19:10

klonodo


1 Answers

So basically the only place i need to set content security policy headers is index?

Correct. CSP is applied to the document and is not affected by AJAX requests.

like image 63
oreoshake Avatar answered Oct 22 '25 03:10

oreoshake



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!