const res = await fetch(forwardUrl, {
...req,
headers: forwardHeaders,
method: req.method,
// body: req.method !== "GET" ? body : null,
body: body ? JSON.stringify(body) : null,
cache: "no-store",
// @ts-ignore
// duplex: "half",
});
// console.log("Response Status", res.status);
// console.log("Response Type", res.type);
// console.log("Response Content Length", res.headers.get("Content-Length"));
// console.log("Response Content Type", res.headers.get("Content-Type"));
// // Clone the response for inspection or logging
// const clone = res.clone();
// // Use the clone to read the body for logging or other processing
// await clone.text(); // or clone.json() if expecting JSON
return new Response(res.body, {
status: res.status,
});
const res = await fetch(forwardUrl, {
...req,
headers: forwardHeaders,
method: req.method,
// body: req.method !== "GET" ? body : null,
body: body ? JSON.stringify(body) : null,
cache: "no-store",
// @ts-ignore
// duplex: "half",
});
// console.log("Response Status", res.status);
// console.log("Response Type", res.type);
// console.log("Response Content Length", res.headers.get("Content-Length"));
// console.log("Response Content Type", res.headers.get("Content-Type"));
// // Clone the response for inspection or logging
// const clone = res.clone();
// // Use the clone to read the body for logging or other processing
// await clone.text(); // or clone.json() if expecting JSON
return new Response(res.body, {
status: res.status,
});