diff --git a/src/app/api/[...path]/proxy-ipfs.ts b/src/app/api/[...path]/proxy-ipfs.ts index 3c1d3cf..6ff4743 100644 --- a/src/app/api/[...path]/proxy-ipfs.ts +++ b/src/app/api/[...path]/proxy-ipfs.ts @@ -106,12 +106,15 @@ async function handleLocalPins(path: string, method: string, req: NextRequest): // POST /api/pins — pin een CID if (p === 'pins' && method === 'POST') { try { - const body = await req.json(); + // Lees body als text, dan parse als JSON (voorkomt "body already read" issues) + const text = await req.text(); + const body = text ? JSON.parse(text) : {}; const { cid, name, size } = body; if (!cid) return NextResponse.json({ error: 'cid required' }, { status: 400 }); await localAddPin(cid, name, size || 0); return NextResponse.json({ cid }); - } catch { + } catch (e) { + console.error('[handleLocalPins] POST error:', e); return NextResponse.json({ error: 'Invalid request' }, { status: 400 }); } }