This is a modified version of a worker that I found on the Cloudflare worker template gallery.
You can compare my version against the original.
This worker support GET, POST, HEAD, and OPTIONS
- Improved code readability
- Improved functionality (Changed 'IFs' to 'Switch', removed unnecessary code, etc.)
- Removed unnecessary HTML response
Copy and paste the content from worker.js
to your Cloudflare Worker code, thats it.
Fetch directly to your worker with the 'q' query followed by the url you want to proxy
https://corsproxy.example.workers.dev/?q=https://example.com/image.png