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

Middleware: Response headers gets set on Request aswell #77652

Open
sommeeeer opened this issue Mar 31, 2025 · 0 comments
Open

Middleware: Response headers gets set on Request aswell #77652

sommeeeer opened this issue Mar 31, 2025 · 0 comments
Labels
Headers Related to the async headers() function. Middleware Related to Next.js Middleware.

Comments

@sommeeeer
Copy link
Contributor

sommeeeer commented Mar 31, 2025

Link to the code that reproduces this issue

https://github.com/sommeeeer/opennext-middleware-request-headers-issue

To Reproduce

  1. pnpm build && pnpm start
  2. curl http://localhost:3000/test
  3. Visit http://localhost:3000/issue-page and http://localhost:3000/issue-action

Current vs. Expected behavior

When you set response headers in middleware.ts I expect it not to be on both the request headers and response headers in any route. Can confirm this is an issue on 15.x.x, and on latest 14.

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: #47~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Oct  2 16:16:55 UTC 2
  Available memory (MB): 14800
  Available CPU cores: 16
Binaries:
  Node: 20.18.0
  npm: 11.1.0
  Yarn: N/A
  pnpm: 9.15.4
Relevant Packages:
  next: 15.2.4 // Latest available version is detected (15.2.4).
  eslint-config-next: 15.2.4
  react: 19.1.0
  react-dom: 19.1.0
  typescript: 5.8.2
Next.js Config:
  output: N/A

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

Middleware, Headers

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

next start (local), next dev (local)

Additional context

I tested with standalone build too. Same problem there.

@github-actions github-actions bot added Headers Related to the async headers() function. Middleware Related to Next.js Middleware. labels Mar 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Headers Related to the async headers() function. Middleware Related to Next.js Middleware.
Projects
None yet
Development

No branches or pull requests

1 participant