creating a new Request from an existing object does not keep the request's method #36522
Closed
1 task done
Labels
Middleware
Related to Next.js Middleware.
Verify canary release
Provide environment information
What browser are you using? (if relevant)
n/a
How are you deploying your application? (if relevant)
n/a
Describe the Bug
throws:
TypeError: Request with GET/HEAD method cannot have body
this is because the polyfill takes method from the optional
init
parameter of Request#constructor:next.js/packages/next/server/web/spec-compliant/request.ts
Lines 19 to 26 in 842e4ec
next.js/packages/next/server/web/sandbox/context.ts
Lines 152 to 173 in d5e767b
Expected Behavior
the expected behaviour is the
method
and any other properties are copied over to the new request objectTo Reproduce
for example in _middleware.ts:
The text was updated successfully, but these errors were encountered: