[BugFix] Swagger UI용 CORS Origin 추가 #25
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📌 작업한 내용
배포된 Swagger UI에서 API 요청 시 발생하던 403 CORS 오류를 해결하기 위해
스프링 WebConfig의 allowedOrigins 목록에 Swagger UI 도메인을 추가했습니다.
원인은 다음 두 가지로 확인되었습니다:
🔍 참고 사항
allowedOrigins에 다음 도메인을 추가했습니다.
https://43-201-35-136.nip.ioSwagger는 API 요청 전 OPTIONS preflight 요청을 보냅니다. 하지만 기존 Caddy 설정은 OPTIONS 요청을 처리하지 못해 403이 발생했습니다. 이를 해결하기 위해 CORS 프리플라이트 핸들러를 추가했습니다.
🖼️ 스크린샷
🔗 관련 이슈
#24
✅ 체크리스트