Revert AuthorizeHttpRequests#forServletPattern

See issue spring-projects/spring-security#13562 for details
This commit is contained in:
Josh Cummings
2024-05-20 09:44:20 -06:00
committed by Sébastien Deleuze
parent 6de92c38ee
commit 883b827d92

View File

@@ -17,13 +17,13 @@ public class WebSecurityConfig {
@Bean
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
return http.authorizeHttpRequests(authorize -> authorize.forServletPattern("/",
(r) -> r.requestMatchers("/rest/anonymous")
.permitAll()
.requestMatchers("/rest/admin")
.hasRole("ADMIN")
.anyRequest()
.authenticated()))
return http
.authorizeHttpRequests(authorize -> authorize.requestMatchers("/rest/anonymous")
.permitAll()
.requestMatchers("/rest/admin")
.hasRole("ADMIN")
.anyRequest()
.authenticated())
.httpBasic(Customizer.withDefaults())
.build();
}