-
-
Notifications
You must be signed in to change notification settings - Fork 41
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
Fetch and fetchProps - adding headers to prevent CORS #227
Comments
The For CORS to work, your Cloudflare worker must return |
Basically you specified valid CORS response headers to fetch request. |
Thanks for responding.
using curl -I https://vet-drugs.vetcalculators.workers.dev shows a valid response but using it in Svelecte like this,
or with
fails due to access control checks. |
You didn't get what I meant: here is your solution REPL. You're welcome 😊 |
Thanks! I used that initially and it failed as I described, but I eventually found that I needed to add this additional header to my cloudfare worker to get it to work.
Again, I really appreciate your help and response! Mike |
Glad you solved it! Sorry for the inconvenience with default WHen thinking about...Probably will be the best to do not set any headers by default and/or allow globally configurable |
I have a cloudfare worker that I access as my App API. When using fetch in Svelecte, it has a CORS issue. I need to add headers but the example to use fetchProps is a bit confusing and I can't get it to work.
My SVelecte works fine with a local json file and the API is accessible via the url in a browser.
My Selecte is setup like this:
script Copied from here (migration-guide)
The text was updated successfully, but these errors were encountered: