Skip to content

Commit

Permalink
fix(netlify-edge): fix body handling
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed May 16, 2023
1 parent 116874f commit 4c825b6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/runtime/entries/netlify-edge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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({
Expand Down

0 comments on commit 4c825b6

Please sign in to comment.