November 2017
Intermediate to advanced
542 pages
14h 24m
English
At times, you may want to only write a header for certain requests. For example, perhaps you want to only protect your login page from being framed. You could use the DelegatingRequestMatcherHeaderWriter class to do so. When using Java configuration, this can be done with the following code:
@Overrideprotected void configure(HttpSecurity http) throws Exception { DelegatingRequestMatcherHeaderWriter headerWriter = new DelegatingRequestMatcherHeaderWriter( new AntPathRequestMatcher("/login"), new XFrameOptionsHeaderWriter()); http.headers() .addHeaderWriter(headerWriter);}
Read now
Unlock full access