• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
  • Mike London

Extending WebSecurityConfigurerAdapter is not adding CSP header

Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In my Spring MVC (5.0.3) application I have added a class SecurityConfig which extends WebSecurityConfigurerAdapter as follows:

My expectation is after browsing http://localhost:2020/webapp/ I will see CSP header in browser's developer console (Network tab). But, nothing related to CSP is added into response header.

I have checked by by applying breaking point at line http.headers().contentSecurityPolicy("script-src 'self'"); and it's hitting one time during context loading.

What's wrong why CSP header is not getting added in response?
    Bookmark Topic Watch Topic
  • New Topic