Error 503 is thrown due to CORS policy
Opened this issue · 0 comments
fabasoad commented
Steps to reproduce
- Create a simple web application with
https://leetcode-stats-api.herokuapp.com/<username>
call inside. - Host it in GitHub pages.
- 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
.