@@ -69,17 +69,24 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti
6969 */
7070 public SecurityFilterChain configureStrictSecurity (HttpSecurity http ) throws Exception {
7171 http .sessionManagement (session -> session .sessionCreationPolicy (SessionCreationPolicy .STATELESS ))
72- .exceptionHandling (Customizer .withDefaults ())
72+ .exceptionHandling (Customizer .withDefaults ())
7373 .addFilterBefore (authenticationFilter (), AnonymousAuthenticationFilter .class )
7474 .authorizeHttpRequests (auth -> {
7575 // auth.requestMatchers("/ds/**").permitAll();
7676 auth .requestMatchers ("/**" ).permitAll ();
77- auth .requestMatchers (SECURED_ENDPOINTS ).authenticated ();
77+ auth .requestMatchers (SECURED_ENDPOINTS ).authenticated ();
7878 })
79- .csrf (csrf -> csrf .disable ())
79+ .headers (headers -> headers
80+ .cacheControl (cache -> cache .disable ())
81+ .addHeaderWriter ((request , response ) -> {
82+ response .setHeader ("Cache-Control" ,
83+ "no-store, no-cache, no-transform, must-revalidate, proxy-revalidate, max-age=0" );
84+ })
85+ )
86+ .csrf (csrf -> csrf .disable ())
8087 .formLogin (form -> form .disable ())
81- .httpBasic (httpBasic -> httpBasic .disable ())
82- .logout (logout -> logout .disable ());
88+ .httpBasic (httpBasic -> httpBasic .disable ())
89+ .logout (logout -> logout .disable ());
8390
8491 return http .build ();
8592 }
0 commit comments