#Request strips CORS headers

1 messages · Page 1 of 1 (latest)

rich plaza
#

I’m trying to migrate to workers an API that checks i-frame-options of a given url. Currently implemented on heroku with axios, I’d like to migrate to workers as it will in theory be much quicker.

Unfortunately, I cannot get fetch and Request to work properly, it seems that the requests are never sent directly to the url provided, but rather go through Cloudflare which strips the headers I am looking for.

Is this by design? Is my usecase not supported by workers?

Kind regards,
Bart

craggy acorn
rich plaza
#

I have encountered the same bug via wrangler cli Vs deployed worker and the in browser edit tool Vs deployed

#

In both "local" cases the fetch is done via a browser which keeps the headers

#

Once deployed to edge the request is served from cloud front cache