File tree Expand file tree Collapse file tree
java/com/back/global/config Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33import org .springframework .beans .factory .annotation .Value ;
44import org .springframework .context .annotation .Bean ;
55import org .springframework .context .annotation .Configuration ;
6+ import org .springframework .http .HttpMethod ;
67import org .springframework .security .config .annotation .method .configuration .EnableMethodSecurity ;
78import org .springframework .security .config .annotation .web .builders .HttpSecurity ;
89import org .springframework .security .config .annotation .web .configuration .EnableWebSecurity ;
@@ -34,6 +35,7 @@ SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
3435
3536 .cors (cors -> cors .configurationSource (corsConfigurationSource ()))
3637 .authorizeHttpRequests (auth -> auth
38+ .requestMatchers (HttpMethod .OPTIONS , "/**" ).permitAll ()
3739 .requestMatchers ("/favicon.ico" ).permitAll ()
3840 .requestMatchers ("/h2-console/**" ).permitAll () // H2 콘솔 접근 허용
3941 .requestMatchers ("/swagger-ui/**" , "/v3/api-docs/**" ).permitAll () // Swagger 접근 허용
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ custom:
4545 - POST
4646 - PUT
4747 - DELETE
48+ - OPTIONS
4849 allowed-headers :
4950 - " *"
5051
Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ custom:
5151 - POST
5252 - PUT
5353 - DELETE
54+ - OPTIONS
5455 allowed-headers :
5556 - " *"
5657
You can’t perform that action at this time.
0 commit comments