Skip to content

feat #32 : 허용 출처 설정 및 CORS Preflight 문제 해결#72

Merged
andrewkimswe merged 2 commits intodevelopfrom
feature/#32
Feb 14, 2025
Merged

feat #32 : 허용 출처 설정 및 CORS Preflight 문제 해결#72
andrewkimswe merged 2 commits intodevelopfrom
feature/#32

Conversation

@yeoeunn
Copy link
Collaborator

@yeoeunn yeoeunn commented Feb 14, 2025

개요

Spring Security 및 CORS 설정을 개선하여 보안을 강화하고, CORS Preflight 문제를 해결함.

PR 유형

어떤 변경 사항이 있나요?

  • 코드 리팩토링
  • 주석 추가 및 수정
  • 보안 설정 강화

변경 사항

  • SecurityConfig 클래스에서 CORS 설정을 수정하여 프론트엔드에서만 접근 가능하도록 제한
  • setMaxAge(3600L) 추가하여 CORS Preflight 요청을 캐싱하도록 설정
  • requestMatchers(HttpMethod.OPTIONS, "/**").permitAll() 추가하여 OPTIONS 요청을 허용하고, HttpMethod를 import
  • setAllowedOrigins(List.of("https://presentalk.store", "https://app.presentalk.store"))로 허용된 도메인 명확하게 지정
  • 불필요한 permitAll() 범위를 줄여 보안 강화

PR Checklist

PR이 다음 요구 사항을 충족하는지 확인하세요.

  • 커밋 메시지 컨벤션에 맞게 작성했습니다.

@yeoeunn yeoeunn requested a review from andrewkimswe February 14, 2025 07:59
@yeoeunn yeoeunn added 🐛 fix 버그 수정 📡 API API 관련 코드 작성 labels Feb 14, 2025
@yeoeunn yeoeunn added this to the 📦 Backend Development milestone Feb 14, 2025
@andrewkimswe andrewkimswe removed their assignment Feb 14, 2025
@yeoeunn yeoeunn linked an issue Feb 14, 2025 that may be closed by this pull request
3 tasks
Copy link
Member

@andrewkimswe andrewkimswe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 Conflicting files가 있습니다.
🔹 .gradle/buildOutputCleanup/buildOutputCleanup.lock
🔹 .gradle/file-system.probe
파일 충돌을 해결한 후 다시 push 해주세요.

그리고 curl이나 브라우저 네트워크 콘솔을 통해 Preflight 요청(OPTIONS) 응답이 정상적으로 오는지 점검하셨나요? 제가 pull 후, curl로 OPTIONS 요청을 테스트했을 때 200 응답이 오지 않아서요...

Copy link
Member

@andrewkimswe andrewkimswe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@andrewkimswe andrewkimswe merged commit c90dae8 into develop Feb 14, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📡 API API 관련 코드 작성 🐛 fix 버그 수정

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

feat : AWS EC2 설정 및 백엔드 애플리케이션 배포

2 participants