From 4c825b6893e4c7bd60bb77a199d75a352a6d2a02 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Fri, 12 May 2023 10:16:57 +0200 Subject: [PATCH] fix(netlify-edge): fix body handling --- src/runtime/entries/netlify-edge.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/runtime/entries/netlify-edge.ts b/src/runtime/entries/netlify-edge.ts index 9afa61cf5f..0d1c3a50ee 100644 --- a/src/runtime/entries/netlify-edge.ts +++ b/src/runtime/entries/netlify-edge.ts @@ -3,6 +3,7 @@ import { nitroApp } from "../app"; import { requestHasBody, useRequestBody } from "../utils"; import { isPublicAssetURL } from "#internal/nitro/virtual/public-assets"; +// https://docs.netlify.com/edge-functions/api/ export default async function (request: Request, _context) { const url = new URL(request.url); @@ -11,8 +12,8 @@ export default async function (request: Request, _context) { } let body; - if (requestHasBody(request)) { - body = await useRequestBody(request); + if (request.body) { + body = await request.arrayBuffer(); } const r = await nitroApp.localCall({