JAVA-058 / Intermediate
Disabling default Spring Security headers
Why is this a problem?
Clickjacking, MIME sniffing and downgrade protections disappear.
How to fix it
java
http.headers(h -> h
.contentSecurityPolicy(c -> c.policyDirectives("default-src 'self'"))
.frameOptions(f -> f.deny())
.httpStrictTransportSecurity(hsts -> hsts.includeSubDomains(true).maxAgeInSeconds(31536000)));