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

Add support for CKAN servers that do not support CORS handling #76

Open
robbieaverill opened this issue Jan 7, 2019 · 0 comments
Open

Comments

@robbieaverill
Copy link
Contributor

robbieaverill commented Jan 7, 2019

Browser: Chrome 71 on macOS

If you type an invalid data.govt.nz URL into the resource locator field, you get this console error:

Access to fetch at 'https://catalogue.data.govt.nz/api/3/action/package_show?id=directory-of-educational-institution'
from origin 'http://ss43.localhost' 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.

I suspect it'll be better to handle this from our end (support CKAN servers that don't provide correct CORS headers) than to expect that they all will.

On a side note, we also get a 404 error from the failed network request in the console too. Ideally we'd handle this gracefully so CMS users won't end up with set of console errors.

cc @camfindlay

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

No branches or pull requests

2 participants