Skip to content

Commit d2f1737

Browse files
committed
feat: OPTIONS 허용
1 parent 3d7d0ce commit d2f1737

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: CI / CD
22

33
on:
44
push:
5-
branches: [main]
5+
branches: [fix/#83-CORS]
66

77
jobs:
88
CI:

src/main/java/com/opendata/global/config/SecurityConfig.java

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import lombok.extern.slf4j.Slf4j;
1616
import org.springframework.context.annotation.Bean;
1717
import org.springframework.context.annotation.Configuration;
18+
import org.springframework.http.HttpMethod;
1819
import org.springframework.security.authentication.AuthenticationManager;
1920
import org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration;
2021
import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity;
@@ -90,11 +91,17 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti
9091
)
9192
)
9293

93-
.authorizeHttpRequests(requests -> requests
94-
.requestMatchers("/oauth2/**","/register/*","/login/oauth2/**", "/swagger-ui/**", // Swagger UI 관련 경로
95-
"/v3/api-docs/**","/api/tourspot/**", "/course/**","/","/login","/auth").permitAll()
96-
.anyRequest().authenticated()
97-
)
94+
.authorizeHttpRequests(requests -> requests
95+
.requestMatchers(HttpMethod.OPTIONS, "/**").permitAll()
96+
97+
.requestMatchers(
98+
"/oauth2/**","/register/*","/login/oauth2/**",
99+
"/swagger-ui/**","/v3/api-docs/**",
100+
"/api/tourspot/**", "/course/**","/","/login","/auth"
101+
).permitAll()
102+
103+
.anyRequest().authenticated()
104+
)
98105
.oauth2Login((oauth2) -> oauth2
99106
.authorizationEndpoint(config -> config
100107
.authorizationRequestRepository(cookieAuthorizationRequestRepository) //설정

0 commit comments

Comments
 (0)