NextRequest
constructor doesn't match Request
behaviour for cloning
#52967
Labels
bug
Issue was opened via the bug report template.
linear: next
Confirmed issue that is tracked by the Next.js team.
locked
Runtime
Related to Node.js or Edge Runtime with Next.js.
Verify canary release
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 22.5.0: Thu Jun 8 22:22:20 PDT 2023; root:xnu-8796.121.3~7/RELEASE_ARM64_T6000 Binaries: Node: 18.13.0 npm: 8.13.2 Yarn: 1.22.19 pnpm: 8.6.6 Relevant Packages: next: 13.4.11-canary.0 eslint-config-next: N/A react: 18.2.0 react-dom: 18.2.0 typescript: 4.9.4 Next.js Config: output: N/A
Which area(s) of Next.js are affected? (leave empty if unsure)
App Router, Middleware / Edge (API routes, runtime)
Link to the code that reproduces this issue or a replay of the bug
https://github.com/tom-sherman/nextrequest-consructor-bug
To Reproduce
Attempt to clone the request like so:
Describe the Bug
Headers and body isn't preserved from
request
in route handlers and middleware.Expected Behavior
As is with
new Request(request)
, headers and body should be preserved/copied into the new request object.Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
NEXT-1468
The text was updated successfully, but these errors were encountered: