Skip to content
This repository has been archived by the owner on Dec 30, 2020. It is now read-only.

US Endpoint blocked by CORS policy #38

Open
richcorbs opened this issue Apr 6, 2020 · 3 comments
Open

US Endpoint blocked by CORS policy #38

richcorbs opened this issue Apr 6, 2020 · 3 comments

Comments

@richcorbs
Copy link

Access to fetch at 'https://covidtracking.com/api/us' from origin 'https://www.richcorbs.com' 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.
@joshwand
Copy link

joshwand commented Apr 6, 2020

@richcorbs i found that adding .json to the end of the url fixed this. Some redirect rule gone awry I suspect.

@webmasterkai
Copy link
Contributor

Looks like the redirect doesn't provide the Access-Control-Allow-Origin. I've disabled the redirect.

@richcorbs
Copy link
Author

Last week the states/daily end point stopped working with .json and the solution was to remove it. The us end point continued to work with .json but I removed it for consistency sake and it continued to work.

Today I learn that us.json is right and states/daily.json works again too.

Hard to work with a moving target. What is the right/official way to use the API? I see in the documentation today that .json seems to be preferred. Is that correct?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants