You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
It looks like if the proxied backend returns Set-Cookie header, it overwrites these headers if they were already set on the user response object.
The problem is that there is no workaround using userResHeaderDecorator because copyProxyResHeadersToUserRes runs before it and already deleted the headers.
fabb
changed the title
Removes Set-Cookie headers that have already been set by previous middleware
copyProxyResHeadersToUserRes overwrites Set-Cookie headers that have already been set by previous middleware
Aug 16, 2024
fabb
added a commit
to fabb/express-http-proxy
that referenced
this issue
Aug 17, 2024
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: