-
Notifications
You must be signed in to change notification settings - Fork 107
Closed
Description
Since version v3.29.0 we are experiencing a problem in our dev setup, due to a wrong port being passed by the proxy in the x-forwarded-port header. Before 3.29 it was correctly set to 3000 (respectively the port the dev server is listening at). Since 3.29 it seems to be set to client port?
This seems to be related to #1051.
The previous implementation set the header like this:
if (!proxyReq.hasHeader('x-forwarded-port')) {
const localPort = req?.socket?.localPort
if (localPort) {
proxyReq.setHeader('x-forwarded-port', req.socket.localPort)
}
}The new implementation does not seem to contain anything comparable.
Adding something like webRequest.headers.set('x-forwarded-port', req.socket.localPort); in
cli/packages/nuxi/src/dev/fetch.ts
Lines 283 to 284 in d436dfa
| const webRequest = new NodeRequest({ req, res }) | |
| const webResponse = await fetchAddress(address, webRequest) |
The x-forwarded-host header is affected in the same way.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels