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

postman cors error #103

Open
tictactoeid opened this issue Sep 4, 2020 · 3 comments
Open

postman cors error #103

tictactoeid opened this issue Sep 4, 2020 · 3 comments
Labels
backend HW0 question Further information is requested

Comments

@tictactoeid
Copy link
Collaborator

tictactoeid commented Sep 4, 2020

postman에서 request를 보낼 경우
스크린샷, 2020-09-04 20-51-48

이런 오류가 발생합니다.
https://hyeonyeee.tistory.com/65
https://velog.io/@devmin/Django-CORS-Setting-basic
를 참고하여 settings.py를 수정하였습니다만, 여전히 오류가 지속되는 상황입니다.
스크린샷, 2020-09-04 20-52-12

서버 로그를 보면 요청 자체는 가는 것 같은데, postman에서 결과를 확인할 수 없습니다.

@tictactoeid tictactoeid added backend HW0 question Further information is requested labels Sep 4, 2020
@davin111
Copy link
Member

davin111 commented Sep 4, 2020

일단 서버 로그를 보면 GET이 아닌 OPTIONS 요청이 가고 있어서 이 부분부터 확인해보시는 것이 좋을 것 같습니다. 그리고 #72 (comment) 에서 공유드렸듯, 맨 끝 /가 빠졌을 때 일반적으로 Django가 붙여주긴 하지만, 어쨌든 끝에 /를 붙여주시는 것이 정확한 endpoint입니다.

@tictactoeid
Copy link
Collaborator Author

왜인지는 모르겠습니다만 postman agent를 설치하였더니 해결되었습니다. 서버 로그에서도 GET 요청이 가고 있습니다. 답변 감사합니다.

@mscheong01
Copy link
Collaborator

저도 같은 문제가 생겼어서 찾아봤었는데, browser 에서 api request 를 할때 security check를 거치는데 이때 문제가 생기는 것이라고 하네요. 아래 링크에 자세히 나와있는데, 참고하면 좋을것 같습니다.
https://blog.container-solutions.com/a-guide-to-solving-those-mystifying-cors-issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend HW0 question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants