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

Provide Access-Control-Allow-Origin header to use CORS #30

Open
tats-u opened this issue Jul 17, 2022 · 0 comments
Open

Provide Access-Control-Allow-Origin header to use CORS #30

tats-u opened this issue Jul 17, 2022 · 0 comments

Comments

@tats-u
Copy link

tats-u commented Jul 17, 2022

image

フロントエンドとAPIが別ドメインで運用されているため、APIのリクエストがブロックされています。
API requests are blocked because the domains for the frontend and the API are different.
XHRのOriginヘッダを見て、適切(本番の場合salmon-stats.yuki.games)ならばAccess-Control-Allow-Originヘッダにそのまま埋め込むようにすれば、サイト内のAPIリクエストが正常に処理されるかと思います。
API requests in the website will be successfully processed if the API check the contents of the Origin header in API requests and copy them to the Access-Control-Allow-Origin header if there is no problem there (salmon-stats.yuki.games in production).

https://developer.mozilla.org/ja/docs/Web/HTTP/Headers/Origin
https://developer.mozilla.org/ja/docs/Web/HTTP/Headers/Access-Control-Allow-Origin
https://developer.mozilla.org/ja/docs/Web/HTTP/CORS

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

No branches or pull requests

1 participant