Conversation
WalkthroughCorsConfig.java의 CORS 허용 원본(origin) 목록이 https://geumpumta.shop과 https://dev.geumpumta.shop을 포함하도록 확장됨. 메서드, 헤더, max-age 및 인증정보 설정은 유지되며, 제어 흐름 및 에러 처리는 영향을 받지 않음. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/main/java/com/gpt/geumpumtabackend/global/config/security/CorsConfig.java (1)
14-14: CORS 허용 도메인 추가를 확인했습니다.프로덕션(
https://geumpumta.shop)과 개발(https://dev.geumpumta.shop) 도메인이 추가되었습니다. 다만, 도메인을 하드코딩하는 것보다application.yml또는 환경 변수를 통해 관리하는 것이 환경별 설정 관리에 더 유리합니다.예시로,
application.yml에서 다음과 같이 설정할 수 있습니다:cors: allowed-origins: - http://localhost:8080 - http://localhost:5173 - https://appleid.apple.com - https://geumpumta.shop - https://dev.geumpumta.shop그리고 코드에서는 다음과 같이 주입받을 수 있습니다:
+import org.springframework.beans.factory.annotation.Value; +import java.util.Arrays; + @Configuration public class CorsConfig { + @Value("${cors.allowed-origins}") + private String[] allowedOrigins; + - public static CorsConfigurationSource corsConfigurationSource() { + @Bean + public CorsConfigurationSource corsConfigurationSource() { CorsConfiguration configuration = new CorsConfiguration(); - configuration.setAllowedOrigins(List.of("http://localhost:8080", "http://localhost:5173", "https://appleid.apple.com", "https://geumpumta.shop", "https://dev.geumpumta.shop")); + configuration.setAllowedOrigins(Arrays.asList(allowedOrigins)); configuration.setAllowedMethods(List.of("GET", "POST", "PUT", "PATCH", "DELETE"));
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/main/java/com/gpt/geumpumtabackend/global/config/security/CorsConfig.java(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build
🔇 Additional comments (1)
src/main/java/com/gpt/geumpumtabackend/global/config/security/CorsConfig.java (1)
12-24: No changes needed—the static method pattern is correctly implemented.The
corsConfigurationSource()method is properly called within thefilterChainPermitAll()@bean method in SecurityConfig.java (line 54). The static method approach is valid here because it's an explicit factory method invoked during security configuration setup, not a bean that needs Spring container management.Likely an incorrect or invalid review comment.
🚀 1. 개요
📝 2. 주요 변경 사항
📸 3. 스크린샷 (API 테스트 결과)
Summary by CodeRabbit
릴리스 노트
✏️ Tip: You can customize this high-level summary in your review settings.