Skip to content

Commit

Permalink
Spring Boot upgrade wip
Browse files Browse the repository at this point in the history
  • Loading branch information
dima767 committed Feb 22, 2021
1 parent f8f58f6 commit 368f8ac
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.springframework.security.crypto.factory.PasswordEncoderFactories;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.web.csrf.CookieCsrfTokenRepository;
import org.springframework.security.web.firewall.DefaultHttpFirewall;
import org.springframework.security.web.firewall.HttpFirewall;
import org.springframework.security.web.firewall.StrictHttpFirewall;
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
Expand Down Expand Up @@ -55,6 +56,11 @@ public HttpFirewall allowUrlEncodedSlashHttpFirewall() {
return firewall;
}

@Bean
public HttpFirewall defaultFirewall() {
return new DefaultHttpFirewall();
}

@Bean
@Profile("!no-auth")
public WebSecurityConfigurerAdapter defaultAuth() {
Expand Down Expand Up @@ -142,7 +148,8 @@ protected void configure(HttpSecurity http) throws Exception {
@Override
public void configure(WebSecurity web) throws Exception {
super.configure(web);
web.httpFirewall(allowUrlEncodedSlashHttpFirewall());
//Switch to the default firewall
web.httpFirewall(defaultFirewall());
}
};
}
Expand Down

0 comments on commit 368f8ac

Please sign in to comment.