From 5a61cafc2fc516a693907025eed145ba12e03da0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rn=20Andre=20Tangen=20=40gorillatron?= Date: Mon, 4 Mar 2024 12:18:52 +0100 Subject: [PATCH] Delete extract-body.ts --- lib/edge/extract-body.ts | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 lib/edge/extract-body.ts diff --git a/lib/edge/extract-body.ts b/lib/edge/extract-body.ts deleted file mode 100644 index 7626ec0cf..000000000 --- a/lib/edge/extract-body.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { NextRequest } from "next/server"; - -export async function extractBody(request: NextRequest) { - const dec = new TextDecoder(); - const reader = request.body?.getReader(); - - if (!reader) return ""; - let body = ""; - - while (true) { - const { done, value } = await reader.read(); - if (done) return body; - - body = body + dec.decode(value); - } -}