Redirect functions return response with body #70901
Labels
bug
Issue was opened via the bug report template.
Navigation
Related to Next.js linking (e.g., <Link>) and navigation.
Pages Router
Related to Pages Router.
Link to the code that reproduces this issue
https://codesandbox.io/p/devbox/dreamy-driscoll-q59dlk?file=%2Fapp%2Fpage.tsx%3A5%2C57
To Reproduce
In a server rendered page I request to and api that respond with 308 status to redirect user to a new location. then I redirect to that location using permanentRedirect function from next/navigation. when I tested the url with curl in terminal I got a long body which should not return after redirect happens
to reproduce run this command in your terminal https://codesandbox.io/p/devbox/dreamy-driscoll-q59dlk?file=%2Fapp%2Fpage.tsx%3A5%2C57
Current vs. Expected behavior
curl localhost/path-that-has-redirect-with-external-api-response
it should return nothing in termanal however I got a big body in response
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 21.6.0: Mon Dec 19 20:46:01 PST 2022; root:xnu-8020.240.18~2/RELEASE_ARM64_T8101 Available memory (MB): 8192 Available CPU cores: 8 Binaries: Node: 20.9.0 npm: 10.1.0 Yarn: 1.22.21 pnpm: N/A Relevant Packages: next: 14.2.14 // Latest available version is detected (14.2.14). eslint-config-next: 14.2.14 react: 18.3.1 react-dom: 18.3.1 typescript: 5.6.2 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Navigation, Pages Router
Which stage(s) are affected? (Select all that apply)
next dev (local), next start (local)
Additional context
No response
The text was updated successfully, but these errors were encountered: