refactor/#240 production CORS 도메인 추가 및 에러 디버깅#242
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Walkthrough이 PR에서는 여러 파일에서 코드 스타일 및 내부 로직이 소폭 수정되었습니다. 주로 파일 끝의 불필요한 개행 제거, CORS 허용 오리진 추가, 로깅 관련 메서드의 내부 처리 변경 및 일부 코드의 주석 처리 등이 이루어졌습니다. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~15분 Possibly related PRs
Suggested reviewers
✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Test Coverage Report
|
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (3)
aics-common/src/main/java/kgu/developers/common/interceptor/LoggingInterceptor.java (1)
31-31: logDuration 호출 주석 해제 권장 (유틸리티 버그 수정 후)LoggingUtils.logDuration의 NPE 원인이 제거되면, 지연 시간 로깅을 복구하세요.
권장 수정(diff):
- // LoggingUtils.logDuration(request, response, ex); + LoggingUtils.logDuration(request, response, ex);aics-common/src/main/java/kgu/developers/common/config/SecurityConfig.java (2)
102-103: 신규 IP 오리진의 스킴/포트 조합 검증 요청아래 두 오리진의 실제 접근 방식(HTTP/HTTPS, 포트 유무)을 운영 환경에서 확인해 주세요. 예를 들어 클라이언트가 HTTPS로 접속하거나 다른 포트를 사용할 경우 현재 설정으로는 CORS가 차단됩니다.
- 현재 추가:
http://175.45.195.63(기본 80 포트 가정)http://203.249.22.207:8080- 확인 제안:
- 실제 트래픽에 HTTPS가 필요한지 (
https://175.45.195.63,https://203.249.22.207:8080등)- 동일 IP에서 여러 포트를 사용할 가능성
- 호스트명이 추가로 필요한지(IP 대신 도메인)
필요 시 동일 항목의 HTTPS 버전 또는 추가 포트 케이스를 함께 등록해 주세요.
87-107: CORS 성능·운영성 개선 제안 (maxAge/설정 외부화)
- Preflight 감소를 위해 maxAge 설정을 권장합니다.
- 운영 환경별 오리진 하드코딩 대신 설정 외부화로 재배포 없이 관리할 수 있게 하는 것을 권장합니다.
코드 예시:
// import 추가 import java.time.Duration; // 설정 내부 config.setMaxAge(Duration.ofHours(1));설정 외부화 예시:
- application.yml
cors: allowed-origin-patterns: "http://localhost:3000,http://localhost:3001,https://aics-client-dev.vercel.app,http://175.45.195.63,http://203.249.22.207:8080"- 주입하여 분리:
@Value("${cors.allowed-origin-patterns}") private String allowedOriginPatterns; config.setAllowedOriginPatterns(Arrays.stream(allowedOriginPatterns.split(",")) .map(String::trim) .toList());
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
aics-admin/src/main/java/kgu/developers/admin/aspect/ServerErrorLoggingAspect.java(1 hunks)aics-api/src/main/java/kgu/developers/api/aspect/ExceptionLoggingAspect.java(1 hunks)aics-api/src/main/java/kgu/developers/api/aspect/ServerErrorLoggingAspect.java(1 hunks)aics-common/src/main/java/kgu/developers/common/config/SecurityConfig.java(1 hunks)aics-common/src/main/java/kgu/developers/common/interceptor/LoggingInterceptor.java(1 hunks)aics-global-utils/src/main/java/kgu/developers/globalutils/logging/LoggingUtils.java(2 hunks)
🔇 Additional comments (4)
aics-api/src/main/java/kgu/developers/api/aspect/ExceptionLoggingAspect.java (1)
44-44: 기능 영향 없음: EOF 개행 제거만 변경동작 변경은 없습니다.
aics-admin/src/main/java/kgu/developers/admin/aspect/ServerErrorLoggingAspect.java (1)
49-49: 기능 영향 없음: EOF 개행 제거만 변경동작 변경은 없습니다.
aics-global-utils/src/main/java/kgu/developers/globalutils/logging/LoggingUtils.java (1)
29-31: NPE 방지용 null 처리 추가 👍obj가 null일 때 문자열 "null"을 반환하여 불필요한 리플렉션 접근을 회피합니다. 적절한 수정입니다.
aics-api/src/main/java/kgu/developers/api/aspect/ServerErrorLoggingAspect.java (1)
49-49: 기능 영향 없음: EOF 개행 제거만 변경동작 변경은 없습니다.
aics-common/src/main/java/kgu/developers/common/config/SecurityConfig.java
Show resolved
Hide resolved
aics-global-utils/src/main/java/kgu/developers/globalutils/logging/LoggingUtils.java
Show resolved
Hide resolved
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## develop #242 +/- ##
==========================================
Coverage 91.42% 91.42%
Complexity 159 159
==========================================
Files 49 49
Lines 455 455
Branches 9 9
==========================================
Hits 416 416
Misses 29 29
Partials 10 10 Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Summary
production CORS 에러 방지를 위해 도메인 및 ip를 추가하고 에러 디버깅을 수행하였습니다
Tasks