File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 11import type { H3Event } from "../event" ;
2- import type { RequestHeaders } from "../types" ;
2+ import type { H3EventContext , RequestHeaders } from "../types" ;
33import { getMethod , getRequestHeaders } from "./request" ;
44import { readRawBody } from "./body" ;
55import { splitCookiesString } from "./cookie" ;
@@ -133,13 +133,12 @@ export function getProxyRequestHeaders(event: H3Event) {
133133export function fetchWithEvent (
134134 event : H3Event ,
135135 req : RequestInfo | URL ,
136- init ?: RequestInit ,
136+ init ?: RequestInit & { context ?: H3EventContext } ,
137137 options ?: { fetch : typeof fetch }
138138) {
139- return _getFetch ( options ?. fetch ) ( req , {
139+ return _getFetch ( options ?. fetch ) ( req , < RequestInit > {
140140 ...init ,
141- // @ts -ignore (context is used for unenv and local fetch)
142- context : init . context || event . context ,
141+ context : init ?. context || event . context ,
143142 headers : {
144143 ...getProxyRequestHeaders ( event ) ,
145144 ...init ?. headers ,
You can’t perform that action at this time.
0 commit comments