From dc14a8714448698ee67cd550e8200395e8ef7f3b Mon Sep 17 00:00:00 2001 From: sycuuui <102959791+sycuuui@users.noreply.github.com> Date: Fri, 19 Apr 2024 12:33:46 +0900 Subject: [PATCH] fix : corsConfig --- src/main/java/com/capic/server/global/config/CorsConfig.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/com/capic/server/global/config/CorsConfig.java b/src/main/java/com/capic/server/global/config/CorsConfig.java index 4ba80e3..53e090d 100644 --- a/src/main/java/com/capic/server/global/config/CorsConfig.java +++ b/src/main/java/com/capic/server/global/config/CorsConfig.java @@ -31,7 +31,11 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { // CORS 허용, CSRF 비활성화 http.cors(Customizer.withDefaults()) .csrf(AbstractHttpConfigurer::disable); + http.sessionManagement((session) -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS)); + http.authorizeHttpRequests((authorize) -> + authorize.requestMatchers( "/api-docs/**", "/swagger-ui/**", "/swagger-ui.html").permitAll() + .anyRequest().permitAll()); return http.build(); } /**