Skip to content

Instantly share code, notes, and snippets.

@tofikhidayatxyz
Created February 10, 2023 04:29
Show Gist options
  • Select an option

  • Save tofikhidayatxyz/f531784509853baa06fbad33b82c155e to your computer and use it in GitHub Desktop.

Select an option

Save tofikhidayatxyz/f531784509853baa06fbad33b82c155e to your computer and use it in GitHub Desktop.
Cloudflare Worker Bypass For CDN
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