Skip to content

Commit 983678f

Browse files
committed
Fix deprecation
1 parent 4b6a909 commit 983678f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

srv/src/main/java/my/bookshop/config/WebSecurityConfig.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
package my.bookshop.config;
22

3-
import static org.springframework.security.web.util.matcher.AntPathRequestMatcher.antMatcher;
4-
53
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
64
import org.springframework.context.annotation.Bean;
75
import org.springframework.context.annotation.Configuration;
86
import org.springframework.core.annotation.Order;
97
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
108
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
119
import org.springframework.security.web.SecurityFilterChain;
10+
import org.springframework.security.web.servlet.util.matcher.PathPatternRequestMatcher;
1211

1312
@Configuration
1413
@ConditionalOnWebApplication
@@ -18,7 +17,7 @@ public class WebSecurityConfig {
1817

1918
@Bean
2019
public SecurityFilterChain configure(HttpSecurity http) throws Exception {
21-
return http.securityMatchers(s -> s.requestMatchers(antMatcher("/swagger/**"))) //
20+
return http.securityMatchers(s -> s.requestMatchers(PathPatternRequestMatcher.withDefaults().matcher("/swagger/**"))) //
2221
.csrf(c -> c.disable()).authorizeHttpRequests(a -> a.anyRequest().permitAll())
2322
.build();
2423
}

0 commit comments

Comments
 (0)