Skip to content

cors 에러 해결#434

Merged
Pridesd merged 23 commits into
mainfrom
develop
Mar 2, 2026
Merged

cors 에러 해결#434
Pridesd merged 23 commits into
mainfrom
develop

Conversation

@Pridesd

@Pridesd Pridesd commented Mar 2, 2026

Copy link
Copy Markdown
Member

타입

  • Feat
  • Fix
  • Refactor
  • Style
  • Rename
  • Remove
  • Comment
  • Design
  • Docs
  • Core

작업 사항

작업한 내용을 추가합니다.

변경 내용

변경 내용/로직을 추가합니다.

관련 이슈

Resolves: #123 ...(해결한 이슈 번호)

See also: #45 #6 ...(참고 이슈 번호)

Summary by CodeRabbit

릴리스 노트

  • Chores
    • 도메인 간 요청(CORS) 설정을 업데이트하여 승인된 도메인 목록을 명시적으로 정의했습니다.
    • 개발, QA, 프로덕션 환경의 CORS 설정을 일관성 있게 정리했습니다.
    • 와일드카드 기반의 폭넓은 접근 권한을 특정 도메인으로 제한하여 보안을 강화했습니다.

Pridesd added 23 commits March 2, 2026 17:17
This reverts commit 5f5acfc.
This reverts commit 5f5acfc.
@coderabbitai

coderabbitai Bot commented Mar 2, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0b5e813 and 961db8d.

📒 Files selected for processing (12)
  • run/src/main/java/com/guide/run/event/controller/EventGetController.java
  • run/src/main/java/com/guide/run/event/controller/EventMatchingController.java
  • run/src/main/java/com/guide/run/event/controller/EventSearchController.java
  • run/src/main/java/com/guide/run/event/controller/EventTestController.java
  • run/src/main/java/com/guide/run/global/security/config/SecurityConfig.java
  • run/src/main/java/com/guide/run/temp/member/controller/ExcelController.java
  • run/src/main/java/com/guide/run/user/controller/LoginInfoController.java
  • run/src/main/java/com/guide/run/user/controller/SignController.java
  • run/src/main/resources/application-batch.yml
  • run/src/main/resources/application-dev.yml
  • run/src/main/resources/application-local.yml
  • run/src/main/resources/application-prod.yml

전체 요약

여러 REST 컨트롤러에 @CrossOrigin 어노테이션을 추가하고, SecurityConfig를 단일 원본(origin) 기반으로 단순화하여 기존 다중 원본 목록 기반 접근 방식을 대체했습니다.

변경 사항

코호트 / 파일(s) 요약
이벤트 컨트롤러
run/src/main/java/com/guide/run/event/controller/EventGetController.java, EventMatchingController.java, EventSearchController.java, EventTestController.java
각 컨트롤러 클래스에 @CrossOrigin 어노테이션을 추가하여 5개의 지정된 원본(QA, 프로덕션, Netlify, localhost:3000)과 3600초 maxAge를 설정했습니다.
사용자 컨트롤러
run/src/main/java/com/guide/run/user/controller/LoginInfoController.java, SignController.java
각 컨트롤러에 @CrossOrigin 어노테이션을 추가하여 개발/프로덕션 환경, localhost 원본 및 allowCredentials 플래그를 설정했습니다.
Excel 컨트롤러
run/src/main/java/com/guide/run/temp/member/controller/ExcelController.java
CORS 원본 설정을 와일드카드("\*")에서 구체적인 5개 원본의 명시적 허용 목록으로 변경했습니다.
보안 설정
run/src/main/java/com/guide/run/global/security/config/SecurityConfig.java
CORS 구성을 경로별 설정에서 단일 공유 설정으로 리팩토링하고, 모든 경로("/**")에 적용되는 단일 원본 기반 구성으로 단순화했습니다.
애플리케이션 설정 파일
run/src/main/resources/application-batch.yml, application-dev.yml, application-local.yml, application-prod.yml
CORS 설정을 다중 원본 목록 기반(cors.allowed-origins)에서 단일 원본 문자열(cors.origin)로 변경했습니다.

예상 코드 리뷰 노력

🎯 2 (Simple) | ⏱️ ~12 분

관련된 가능성 있는 PR

  • fix: 환경별 CORS 정책 분리 및 health 예외 처리 #432: 동일한 CORS 관련 컨트롤러와 SecurityConfig를 수정하며, 단일 원본으로 단순화하는 방향성이 동일합니다.
  • cors 수정 #433: 동일한 CORS 코드 경로(Event/\* 및 사용자 컨트롤러의 컨트롤러 수준 @CrossOrigin, SecurityConfig CORS 설정, application YAML)를 수정하며 직접적인 관련성이 있습니다.

제안하는 리뷰어

  • 2ralumin
  • JaeGeon-SMU

시 🐰

원본들을 정렬하여 질서를 찾고,
CORS의 미로에서 길을 밝혔네,
와일드카드를 넘어 보안을 향해,
단일 설정으로 모두 통합하니,
이제 요청들이 부드럽게 흐른다네 🌊✨

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch develop

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Pridesd Pridesd merged commit 91c76cc into main Mar 2, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant