Worker timeout when pass-through streaming

I'm using a worker to pass-through stream Github releases that are in a private repo that needs authorisation.

This is working fine unless on a slow connection where the download time exceeds the worker limit of 30 seconds.

Is there a way to do this with workers?

const url = `https://api.github.com/repos/${org}/${repo}/releases/assets/${id}`;

let response = await fetch(url, {
  headers: {
    Authorization: `token ${env.GITHUB_TOKEN}`,
    accept: "application/octet-stream",
    "User-Agent": "Cloudflare Workers",
  },
});

if (response.body) {
  return new Response(response.body);
}
Was this page helpful?