• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
  • salvin francis
  • Frits Walraven
  • Piet Souris

Extending WebSecurityConfigurerAdapter is not adding CSP header

Posts: 1
  • Mark post as helpful
  • send pies
  • 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?
I would challenge you to a battle of wits, but I see you are unarmed - shakespear. Unarmed tiny ad:
the value of filler advertising in 2020
    Bookmark Topic Watch Topic
  • New Topic