Skip to content

Commit

Permalink
fix: context object spread
Browse files Browse the repository at this point in the history
  • Loading branch information
barisbora committed Nov 20, 2022
1 parent 4e770d2 commit f62e761
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/runtime/entries/cloudflare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ async function handleEvent (event: FetchEvent) {
body = Buffer.from(await event.request.arrayBuffer())
}

const headers = Object.fromEntries(event.request.headers.entries())

const localCall = createCall(toNodeListener(nitroApp.h3App, {
headers,
cf: (event.request as unknown as RequestInit)?.cf
}) as any)

Expand Down Expand Up @@ -74,7 +71,7 @@ function normalizeOutgoingHeaders (headers: Record<string, string | string[] | u
function toNodeListener (app: App, context: H3EventContext): NodeListener {
const toNodeHandle: NodeListener = async function (req, res) {
const event = createEvent(req, res)
event.context = { ...event.context, context }
event.context = { ...event.context, ...context }
try {
await app.handler(event)
} catch (_error: any) {
Expand Down

0 comments on commit f62e761

Please sign in to comment.