From 6d88a7314d8785ff0d434b0b026f17db2dba2568 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Wed, 5 Jan 2022 18:19:23 +0000 Subject: [PATCH] fix(nitro): pass `Headers` to `createFetch` (#2615) --- packages/nitro/src/runtime/server/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/nitro/src/runtime/server/index.ts b/packages/nitro/src/runtime/server/index.ts index 86d3a3215b..b300ab3fc8 100644 --- a/packages/nitro/src/runtime/server/index.ts +++ b/packages/nitro/src/runtime/server/index.ts @@ -1,6 +1,6 @@ import '../app/config' import { createApp, useBase } from 'h3' -import { createFetch } from 'ohmyfetch' +import { createFetch, Headers } from 'ohmyfetch' import destr from 'destr' import { createCall, createFetch as createLocalFetch } from 'unenv/runtime/fetch/index' import { timingMiddleware } from './timing' @@ -22,6 +22,6 @@ export const handle = useBase(process.env.ROUTER_BASE, app) export const localCall = createCall(handle) export const localFetch = createLocalFetch(localCall, globalThis.fetch) -export const $fetch = createFetch({ fetch: localFetch }) +export const $fetch = createFetch({ fetch: localFetch, Headers }) -globalThis.$fetch = $fetch +globalThis.$fetch = $fetch as any