Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redirect functions return response with body #70901

Open
mehran13chartbox opened this issue Oct 7, 2024 · 0 comments
Open

Redirect functions return response with body #70901

mehran13chartbox opened this issue Oct 7, 2024 · 0 comments
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.

Comments

@mehran13chartbox
Copy link

mehran13chartbox commented Oct 7, 2024

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

@mehran13chartbox mehran13chartbox added the bug Issue was opened via the bug report template. label Oct 7, 2024
@github-actions github-actions bot added Navigation Related to Next.js linking (e.g., <Link>) and navigation. Pages Router Related to Pages Router. labels Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

No branches or pull requests

1 participant