Zibri/cloudflare-cors-anywhere ? reverse-engineered prompt
Reverse engineered prompt
Build me a simple CORS proxy that runs on a Cloudflare Worker so I can call third party APIs from the browser without getting blocked by CORS.
I want it to work like this, I hit my worker with a URL such as /?https://example.com/api and it forwards the request to that target, including the original method, body, and headers. It should support normal fetch and XHR style requests, and let me pass extra headers through a special x-cors-headers header as JSON so even restricted headers can be sent when needed.
On the way back, please add the right CORS response headers so any site can read the response, and include all headers received from the upstream server in a response header called cors-received-headers, serialized as JSON, so things like set cookie style headers can still be inspected.
Please keep it very lightweight and easy to deploy to my own Cloudflare account with Wrangler. If anything about Workers has changed, look up the current docs and make it work with the modern setup.
Have a live product UI? Try website reverse