From 0b55f3cdc22d3e8fa3996d1d6f5f15dddadb9e54 Mon Sep 17 00:00:00 2001 From: Ahad Birang Date: Wed, 2 Mar 2022 21:26:39 +0330 Subject: [PATCH] fix: pass Headers to createFetch (#7) --- src/runtime/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/runtime/index.ts b/src/runtime/index.ts index c8ff388673..eac80a7fe9 100644 --- a/src/runtime/index.ts +++ b/src/runtime/index.ts @@ -1,6 +1,6 @@ import './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' @@ -21,6 +21,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