next.js
1caa5808 - fix: correctly set `x-forwarded-*` in Middleware (#57815)

Commit
2 years ago
fix: correctly set `x-forwarded-*` in Middleware (#57815) ### What? Follow-up of #56797 While working on this, I noticed that some logic around stripping internal headers was duplicated, so I did some cleanup too. ### Why? In #56797 we set these headers, but it only affected Route Handlers, Middleware is still missing them, which is a regression introduced in #52492 (Related: https://github.com/vercel/next-learn/issues/252) ### How? Move to set these headers up to `base-server.ts` so they are present in Middleware too. > Note: All headers are set with `??=` to respect the original value if set (with other words, only add these headers if they aren't set yet) Closes NEXT- Fixes #52266
Author
Parents
Loading