feat(F-127): completed feature

This commit is contained in:
chattie
2026-08-21 17:56:15 +02:00
parent e5126797a6
commit 50229c5ce4
10 changed files with 231 additions and 10 deletions

View File

@@ -109,7 +109,14 @@ export async function DELETE(req: NextRequest) {
method: 'DELETE',
headers: { Cookie: cookies },
});
return NextResponse.json({ ok: backendRes.ok }, { status: backendRes.status });
// Reenviar la respuesta del backend tal cual: el backend puede devolver
// 204 No Content (sin body) en borrados exitosos, y forzar un JSON con
// status 204 es HTTP inválido (F-127).
return new Response(backendRes.body, {
status: backendRes.status,
statusText: backendRes.statusText,
headers: { 'Content-Length': backendRes.headers.get('content-length') ?? '0' },
});
} catch {
return NextResponse.json({ error: 'Proxy error' }, { status: 502 });
}