Skip to content

Error 503 is thrown due to CORS policy #6

Open
@fabasoad

Description

@fabasoad

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions