Skip to content

Error 503 is thrown due to CORS policy #6

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

Open
fabasoad opened this issue Feb 11, 2023 · 0 comments
Open

Error 503 is thrown due to CORS policy #6

fabasoad opened this issue Feb 11, 2023 · 0 comments

Comments

@fabasoad
Copy link

Steps to reproduce

  1. Create a simple web application with https://leetcode-stats-api.herokuapp.com/<username> call inside.
  2. Host it in GitHub pages.
  3. Open it in browser

Expected behavior
Call should be valid and 200 status code should be returned with response body.

Actual behavior
503 error is returned and the following error is printed in console:

Access to fetch at 'https://leetcode-stats-api.herokuapp.com/johndoe' from origin 'https://johndoe.github.io' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

Recommendation for fix
Allow CORS requests from https://*.github.io.

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