CORS headers overrided when using remote dev
I'm using sveltekit And there is CORS problem when i qurey from D1 database (In remote dev mode)(send form to server and query or insert and return success response)
So I added hooks.server.ts to add headers (Access-Control-Allow- ..) but cloudflare overrides it..
how can i solve this problem? or any way move data from cloudflare d1 database to local database?
ps. if i use 'wrangler dev --local' it works
first image is local dev
second image is remote dev
with same code
(sorry about second image.. i think that's critical for security..)
![No description](https://cdn.answeroverflow.com/1200114962220195891/image.png)
![No description](https://cdn.answeroverflow.com/1200114962488639538/image.png)
1 Reply
I'm running into something similar with a simple http api. for whatever reason the origin is being rewritten to the wrangler dev server address