File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 1
1
import type { H3Event } from "../event" ;
2
2
import type { H3EventContext , RequestHeaders } from "../types" ;
3
- import { getMethod , getRequestHeaders } from "./request" ;
3
+ import { getRequestHeaders } from "./request" ;
4
4
import { splitCookiesString } from "./cookie" ;
5
5
import { sanitizeStatusMessage , sanitizeStatusCode } from "./sanitize" ;
6
6
import { readRawBody } from "./body" ;
@@ -35,13 +35,10 @@ export async function proxyRequest(
35
35
target : string ,
36
36
opts : ProxyOptions = { }
37
37
) {
38
- // Method
39
- const method = opts . fetchOptions ?. method || getMethod ( event ) ;
40
-
41
- // Body
38
+ // Request Body
42
39
let body ;
43
40
let duplex : Duplex | undefined ;
44
- if ( PayloadMethods . has ( method ) ) {
41
+ if ( PayloadMethods . has ( event . method ! ) ) {
45
42
if ( opts . streamRequest ) {
46
43
body = event . body ;
47
44
duplex = "half" ;
@@ -50,6 +47,9 @@ export async function proxyRequest(
50
47
}
51
48
}
52
49
50
+ // Method
51
+ const method = opts . fetchOptions ?. method || event . method ! ;
52
+
53
53
// Headers
54
54
const fetchHeaders = mergeHeaders (
55
55
getProxyRequestHeaders ( event ) ,
You can’t perform that action at this time.
0 commit comments