-
Notifications
You must be signed in to change notification settings - Fork 234
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
copyProxyResHeadersToUserRes overwrites Set-Cookie headers that have already been set by previous middleware #547
Comments
The problem is this line: https://github.com/villadora/express-http-proxy/blob/master/app/steps/copyProxyResHeadersToUserRes.js#L13 It looks like if the proxied backend returns The problem is that there is no workaround using |
@fabb Thanks for the detailed report and fix. I'll review this week. |
@monkpow friendly reminder 🙂 |
@monkpow friendly reminder, plz review :-) |
We have some middlewares before the proxy middleware to handle setting cookies (like authentication and others).
We set cookies like this in previous middlewares:
res.cookie('name', 'value')
.Responses that are proxies do not contain these
Set-Cookie
headers though. Other headers seem to pass fine.We do not use
userResHeaderDecorator
.express-http-proxy should not remove any
Set-Cookie
headers that have already been set on the response object.The text was updated successfully, but these errors were encountered: