Workers/Pages do have support for some of `node:crypto`. Which modules do you need?
Workers/Pages do have support for some of
node:crypto. Which modules do you need?content-disposition header (it looks like you're making the request with the header, which is different)text/plain, in your example I could do a contentType query param of video/webm and the browser would think my text file is a videofetch(url), and another 1000 to in-house things (KV, R2, DO, D1, you get the idea)try/catch around the subrequeste.name === "subrequest limit exceeded"?code, etc. but not everything does, sadlyconst newRequest = new Request(request);
const contentType = url.searchParams.get("content-type");
if (contentType) {
newRequest.headers.set("Content-Type", contentType);
}
const contentDisposition = url.searchParams.get("content-disposition");
if (contentDisposition) {
newRequest.headers.set("Content-Disposition", contentDisposition);
}
return fetch(new URL(url.pathname, `https://${requiredHostname}`), newRequest);content-dispositiontext/plaincontentTypevideo/webmfetch(url)try/catche.name === "subrequest limit exceeded"const res = fetch(new URL(url.pathname, `https://${requiredHostname}`));
// Clone the response because it's immutable by default.
const clonedRes = new Response(res.body, res);
clonedRes.headers.set("Content-Disposition", contentDisposition);
clonedRes.headers.set("Content-Type", contentType);
return clonedResexport default {
async fetch() {
try {
while (true) { await fetch("https://cloudflare.com/cdn-cgi/trace") }
} catch (e) {
return new Response(JSON.stringify(e, Object.getOwnPropertyNames(e)))
}
},
};{"stack":"Error: Too many subrequests.\n at Object.fetch (worker.js:15:28)","message":"Too many subrequests."}