File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
srv/src/main/java/my/bookshop/config Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change 11package my .bookshop .config ;
22
3- import static org .springframework .security .web .util .matcher .AntPathRequestMatcher .antMatcher ;
4-
53import org .springframework .boot .autoconfigure .condition .ConditionalOnWebApplication ;
64import org .springframework .context .annotation .Bean ;
75import org .springframework .context .annotation .Configuration ;
86import org .springframework .core .annotation .Order ;
97import org .springframework .security .config .annotation .web .builders .HttpSecurity ;
108import org .springframework .security .config .annotation .web .configuration .EnableWebSecurity ;
119import 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 }
You can’t perform that action at this time.
0 commit comments