I am working on a spring boot application with an Angular app as a front application. From the back, I send the CSP policy as the above
.and()
.headers()
.contentSecurityPolicy(default-src 'self'; frame-src 'self'; script-src 'self' 'unsafe-inline' https://storage.googleapis.com; style-src 'self' 'unsafe-inline'; img-src 'self'; font-src 'self' object-src; require-trusted-types-for 'script')
When I run the application on dev, and I changed the CSP policy, I get errors on the console of the Angular front which is a normal thing. When I run the application on prod, even I change the CSP policy with
default-src 'self'
the application continues to function which is strange.
So my questions are:
- Where the Angular gets the CSP policy on the code?
- On prod mode, Can we have a CSP policy?
PS: I am using Angular version 8.2.4