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

Enable CORS for the 404 error page #1052

Open
oeway opened this issue Feb 6, 2020 · 0 comments
Open

Enable CORS for the 404 error page #1052

oeway opened this issue Feb 6, 2020 · 0 comments

Comments

@oeway
Copy link

oeway commented Feb 6, 2020

After #177 and #182 , BinderHub API can be accessed from another origin, which is great. However, I noticed that if there is an error, the access-control-allow-origin: * header won't be send. The subsequent operation will be blocked, and the js code won't even know it's a 404 response.

It also triggers a series of error messages in the console if the kernel is dead and we keep requesting for example https://hub.gke.mybinder.org/user/oeway-cellpose-bifgkoq9/api/kernelspecs?1581014837233.

Access to fetch at 'https://hub.gke.mybinder.org/user/oeway-cellpose-bifgkoq9/api/kernelspecs?1581014837233' from origin 'https://lib.imjoy.io' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: 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 think it would be nicer if the 404 page can also allow CORS.

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