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

Forwarded request headers are null #55942

Closed
1 task done
razvanMiu opened this issue Sep 25, 2023 · 2 comments · Fixed by #56797
Closed
1 task done

Forwarded request headers are null #55942

razvanMiu opened this issue Sep 25, 2023 · 2 comments · Fixed by #56797
Labels
bug Issue was opened via the bug report template. linear: next Confirmed issue that is tracked by the Next.js team. locked

Comments

@razvanMiu
Copy link

razvanMiu commented Sep 25, 2023

Link to the code that reproduces this issue

https://github.com/razvanMiu/nextjs-forwarded-headers-issue

To Reproduce

  1. Start application in development (npm run dev)
  2. Check logged value of X-Forwarded-Host header

Current vs. Expected behavior

Following the steps from the previous section, I expected the X-Forwarded-Host to return the current host but I get null instead.
I use X-Forwarded-Host to forward the server name of nginx and it worked as expected in nextjs <= 13.4.12

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
      Platform: darwin
      Arch: arm64
      Version: Darwin Kernel Version 22.5.0: Mon Apr 24 20:52:24 PDT 2023; root:xnu-8796.121.2~5/RELEASE_ARM64_T6000
    Binaries:
      Node: 20.5.1
      npm: 9.8.0
      Yarn: N/A
      pnpm: N/A
    Relevant Packages:
      next: 13.5.2
      eslint-config-next: 13.5.2
      react: 18.2.0
      react-dom: 18.2.0
      typescript: 5.2.2
    Next.js Config:
      output: N/A

Which area(s) are affected? (Select all that apply)

Not sure

Additional context

The first version that introduced the bug is 13.4.13-canary.0 since reverting to 13.4.12 works as expected

NEXT-1663

@razvanMiu razvanMiu added the bug Issue was opened via the bug report template. label Sep 25, 2023
@balazsorban44 balazsorban44 added the linear: next Confirmed issue that is tracked by the Next.js team. label Sep 28, 2023
@juanpin-humane

This comment was marked as off-topic.

@kodiakhq kodiakhq bot closed this as completed in #56797 Oct 13, 2023
kodiakhq bot pushed a commit that referenced this issue Oct 13, 2023
### What?

Adding back `x-forwarded-*` headers.


### Why?

Starting with #52492, these headers were lost.

### How?

We can populate these headers before executing a request.

Closes NEXT-1663
Fixes #55942
@github-actions
Copy link
Contributor

This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template. linear: next Confirmed issue that is tracked by the Next.js team. locked
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants