Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 프로덕션 환경에서는 특정 Origin만 참조하도록 수정 #79

Merged
merged 1 commit into from
Nov 17, 2024

Conversation

Coalery
Copy link
Member

@Coalery Coalery commented Nov 17, 2024

주요 변경 사항

프로덕션 환경에서는 특정 origin만 CORS가 허용되도록 수정합니다.

변경 이유

axios에서 withCredentials를 통해 쿠키와 함께 요청을 보내면, 서버의 응답 헤더에서 Access-Control-Allow-Origin의 값에 와일드카드를 사용하는 경우 보안 문제로 CORS 에러를 일으킵니다. 따라서, 프로덕션 환경에서는 특정 도메인만 허용하도록 합니다.

Access to XMLHttpRequest at 'https://api.khlug.org/manager/door-lock-password' from origin 'https://app.khlug.org' has been blocked by CORS policy: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.

@Coalery Coalery self-assigned this Nov 17, 2024
@Coalery Coalery merged commit 5a0ca51 into main Nov 17, 2024
2 checks passed
@Coalery Coalery deleted the fix/exactly-origin branch November 17, 2024 08:17
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