backend opti
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user