backend opti

This commit is contained in:
2026-05-14 18:12:58 +02:00
parent 2ace527c9f
commit 43a9c26497
3 changed files with 25 additions and 9 deletions
+4 -7
View File
@@ -29,13 +29,10 @@ export const ALL: APIRoute = async ({ request, params }) => {
headers,
};
if (request.method !== 'GET' && request.method !== 'HEAD') {
const reqClone = request.clone();
if (request.method !== 'DELETE' || reqClone.body) {
fetchOptions.body = reqClone.body;
// @ts-ignore — required by Node fetch when body is a stream
fetchOptions.duplex = 'half';
}
if (request.method !== 'GET' && request.method !== 'HEAD' && request.body) {
fetchOptions.body = request.body;
// @ts-ignore — required by Node fetch when body is a stream
fetchOptions.duplex = 'half';
}
const response = await fetch(url.toString(), fetchOptions);