From 3a95c3e93f4c33e74844074a1e875e957d34e730 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 2 May 2026 23:12:34 +0000 Subject: [PATCH] frontend: skip body in proxy for 204/205/304 responses Response constructor rejects bodies on these statuses, so DELETE returning 204 was triggering a 500 in the proxy. Co-Authored-By: Claude Opus 4.7 --- frontend/app/api/proxy/[[...path]]/route.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/app/api/proxy/[[...path]]/route.ts b/frontend/app/api/proxy/[[...path]]/route.ts index 75df245..0191ab6 100644 --- a/frontend/app/api/proxy/[[...path]]/route.ts +++ b/frontend/app/api/proxy/[[...path]]/route.ts @@ -31,7 +31,9 @@ async function handler( body, }); - const data = await res.arrayBuffer(); + // Per Fetch spec, Response with 204/205/304 must not have a body. + const hasBody = res.status !== 204 && res.status !== 205 && res.status !== 304; + const data = hasBody ? await res.arrayBuffer() : null; return new NextResponse(data, { status: res.status,