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

Command line option for custom headers #206

Merged
merged 4 commits into from
Nov 13, 2019

Conversation

ivan-gomes
Copy link
Contributor

@ivan-gomes ivan-gomes commented Jun 3, 2019

Resolves #205.

configurable-http-proxy supports a wide range of configuration options, but it is not practical for it to cover all use cases. An example of an uncovered use case is the Strict-Transport-Security response header. Instead of adding yet another configuration option specifically for this header I propose we implement a --custom-headers <headers> configuration option that allows for user-specified headers to be added to all proxied requests. Upstream projects like https://github.com/jupyterhub/zero-to-jupyterhub-k8s can expose the option to be passed to configurable-http-proxy, for example through the Helm chart.

@rgbkrk
Copy link
Member

rgbkrk commented Jun 5, 2019

My only main question is whether these headers are applied after other headers being set and if we should document so here.

@ivan-gomes
Copy link
Contributor Author

Custom headers are indeed applied after all other headers using the proxyRes callback.

@rgbkrk rgbkrk requested a review from minrk June 6, 2019 16:10
Copy link
Member

@minrk minrk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense! Minor comments on the implementation.

bin/configurable-http-proxy Outdated Show resolved Hide resolved
bin/configurable-http-proxy Outdated Show resolved Hide resolved
@rgbkrk rgbkrk self-requested a review June 14, 2019 22:27
@rgbkrk
Copy link
Member

rgbkrk commented Jun 14, 2019

Min's points are solid so I've set myself to pending review (though GitHub still shows my approval).

@ivan-gomes
Copy link
Contributor Author

Implemented @minrk's points. Thanks for the guidance. @rgbkrk would you mind re-approving?

@ivan-gomes ivan-gomes requested a review from minrk October 16, 2019 05:07
@minrk minrk merged commit c25b7eb into jupyterhub:master Nov 13, 2019
@minrk
Copy link
Member

minrk commented Nov 13, 2019

Thanks! Sorry for being so slow

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.

Command line option for custom headers
3 participants