Skip to content

Commit

Permalink
Merge pull request #131 from prgrms-web-devcourse-final-project/develop
Browse files Browse the repository at this point in the history
WebConfig 수정 배포
  • Loading branch information
rinklove authored Jan 13, 2025
2 parents e0592d9 + 68a34b2 commit aa72768
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions RevUp-common/src/main/java/com/revup/config/WebConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,23 @@ public CorsConfigurationSource corsConfigurationSource() {
configuration.setAllowedOrigins(List.of(
"https://revup-eight.vercel.app",
githubPageUrl,
"http://localhost:3000",
"nginx"
"http://localhost:3000"
));
configuration.setAllowedMethods(List.of("GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"));
configuration.setAllowedHeaders(List.of("*"));
// 허용할 요청 헤더 설정
configuration.setAllowedHeaders(List.of(
"Authorization", // 인증 토큰
"Content-Type", // 요청 본문의 콘텐츠 타입
"Accept", // 클라이언트가 기대하는 응답 타입
"Cookie" // 쿠키 정보 (필요한 경우)
));
configuration.setAllowCredentials(true);

// 필요한 헤더만 노출
configuration.setExposedHeaders(List.of(
"Authorization-refresh",
"Authorization",
"Set-Cookie",
"Cookie"
"Set-Cookie"
));

UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
Expand Down

0 comments on commit aa72768

Please sign in to comment.