Created
February 10, 2023 04:29
-
-
Save tofikhidayatxyz/f531784509853baa06fbad33b82c155e to your computer and use it in GitHub Desktop.
Cloudflare Worker Bypass For CDN
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| addEventListener("fetch", event => { | |
| event.respondWith(handleRequest(event.request)) | |
| }) | |
| async function handleRequest(request) { | |
| const url = new URL(request.url) | |
| return await fetch(`https://S3_URL_HERE${url.pathname}`) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment