feat: Add mergeCookies
option
#1318
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
mergeCookie
options allow to mergeset-cookie
header form passed request object and from a target responseTest added.
Documentation updated.
Use Case:
In the project, I'm working on currently, we are using
Express-Gateway
(https://github.com/ExpressGateway/express-gateway) as a single entry point for a set of microservices.Express-Gateway
useshttp-proxy
when proxeing requests to a destination service.In the gateway we have to setup a cookie with CSRF token.
But some endpoints of our microservices setups it's own cookies and in this case all cookies, that has been setuped in gateway wipes out by cookies from a microservice response.
Raw example:
Curl:
By this pull-request I want to add one more option that will instruct proxy-server to merge
set-cookie
header instead of overwriting it.Existing behaviour remains the same.