Skip to content
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

feat: new option to change headers addition behavior #168

Conversation

jhonndabi
Copy link
Contributor

In the use case we have using this library, we want to have the same behavior if we change the response_mode when adding upstream headers to the current conn, today this is not true.
When we use response_mode: :stream the code add headers with Plug.Conn.put_resp_header/3 that replace the headers that already exists in the conn.
When we use response_mode: :buffer the code add headers with Plug.Conn.prepend_resp_headers/2 that prepends the upstream headers in the conn resp headers.
This PR attempts to resolve this issue by adding a new option to change the header addition behavior according to response_mode. And set the default options to values that will be backwards compatible.

And I think this PR also helps to solve this issue #165.

@jhonndabi
Copy link
Contributor Author

@mwhitworth Could you review this PR too, please?

@mwhitworth mwhitworth force-pushed the feat/new-option-to-change-headers-addition-behavior branch from 49593c6 to 957681e Compare November 22, 2023 08:50
@mwhitworth mwhitworth merged commit 5f6a590 into tallarium:master Nov 22, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants