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 1
1
import type { H3Event } from "../event" ;
2
- import type { RequestHeaders } from "../types" ;
2
+ import type { H3EventContext , RequestHeaders } from "../types" ;
3
3
import { getMethod , getRequestHeaders } from "./request" ;
4
4
import { readRawBody } from "./body" ;
5
5
import { splitCookiesString } from "./cookie" ;
@@ -133,13 +133,12 @@ export function getProxyRequestHeaders(event: H3Event) {
133
133
export function fetchWithEvent (
134
134
event : H3Event ,
135
135
req : RequestInfo | URL ,
136
- init ?: RequestInit ,
136
+ init ?: RequestInit & { context ?: H3EventContext } ,
137
137
options ?: { fetch : typeof fetch }
138
138
) {
139
- return _getFetch ( options ?. fetch ) ( req , {
139
+ return _getFetch ( options ?. fetch ) ( req , < RequestInit > {
140
140
...init ,
141
- // @ts -ignore (context is used for unenv and local fetch)
142
- context : init . context || event . context ,
141
+ context : init ?. context || event . context ,
143
142
headers : {
144
143
...getProxyRequestHeaders ( event ) ,
145
144
...init ?. headers ,
You can’t perform that action at this time.
0 commit comments