Skip to content

The --custom-header doesn't do anything #223

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

Closed
aramcap opened this issue Dec 20, 2019 · 2 comments · Fixed by #242
Closed

The --custom-header doesn't do anything #223

aramcap opened this issue Dec 20, 2019 · 2 comments · Fixed by #242
Labels

Comments

@aramcap
Copy link

aramcap commented Dec 20, 2019

I want to send a custom header to backend servers. I think the only way is with "--custom-header" argument, but if It isn't correct please help me.

So, when I run CHP with "--custom-header" I don't watch this be running correctly.

For example:

I run CHP with this options:

> node_modules/.bin/configurable-http-proxy --ip 0.0.0.0 --port 8080 --api-ip 127.0.0.1 --api-port 8081 --log-level debug --custom-header "Authorization":"token kYFkuyfKUYf"

Then the backend server should receive the header, but NO!

127.0.0.1 - - [20/Dec/2019 13:10:22] "GET / HTTP/1.1" 200 -
{'X-Forwarded-Host': 'localhost:8080', 'X-Forwarded-Proto': 'http', 'X-Forwarded-Port': '8080', 'X-Forwarded-For': '127.0.0.1', 'Cache-Control': 'no-cache', 'Pragma': 'no-cache', 'Upgrade-Insecure-Requests': '1', 'Cookie': 'io=gkj_1lr05tkDtKyqAAAJ; __wzd22063e6fcb4b21b39a2f=1574782783|3600d444d719; ajs_user_id=null; ajs_group_id=null', 'Connection': 'close', 'Accept-Encoding': 'gzip, deflate', 'Accept-Language': 'es,en;q=0.5', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Host': 'localhost:8080'}

What is happening?

@anupclouddevops
Copy link

I am facing the same issue when I am starting the CHP with jupyterhub using the below options
c.ConfigurableHTTPProxy.command = ['configurable-http-proxy', '--custom-header', 'X-test-header:test']
The process starts with these command line options and I can see it when I a grep on the process.

node /bin/configurable-http-proxy --custom-header X-test-header:test --ip --port 8000 --api-ip 127.0.0.1 --api-port 8001 ..........

However, I don't get this header in the response...

I want to set 'Strict-Transport-Security: max-age=31536000; includeSubDomains; preload' using these options.

Please suggest if this customHeader option has been tested or not.

@consideRatio
Copy link
Member

I could reproduce this, and think I have fixed it in #242.

@consideRatio consideRatio changed the title --custom-header not work The --custom-header doesn't do anything May 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants