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

Show a meaningful error on CORS error #26

Open
koenvo opened this issue Dec 21, 2022 · 1 comment
Open

Show a meaningful error on CORS error #26

koenvo opened this issue Dec 21, 2022 · 1 comment

Comments

@koenvo
Copy link
Owner

koenvo commented Dec 21, 2022

When a request works in a regular python environment but not in the browser, often the problem are the lack of CORS headers/support, or blocked by a policy.

Make sure the end-user will get a meaningful error message which makes it easier to understand what's going wrong.

  1. On request error try to determine if it's related to CORS (SO says it's not possible - https://stackoverflow.com/questions/19325314/how-to-detect-cross-origin-cors-error-vs-other-types-of-errors-for-xmlhttpreq)
  2. Raise an exception with a pointer to a CORS tester like https://cors-test.codehappy.dev/
  3. Try to give pointers on how to fix this, and more details about CORS - https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS

Related issue:

@koenvo koenvo changed the title Show a meaningful error when CORS headers are not set Show a meaningful error on CORS error Dec 21, 2022
@koenvo
Copy link
Owner Author

koenvo commented Jun 1, 2023

This looks interesting: http://allorigins.win/

Found at https://github.com/y-crdt/ypy#ypy-in-wasm-pyodide

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