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

Header parameter names are converted to lower case by proxy #65

Closed
ctornau opened this issue Sep 28, 2015 · 4 comments
Closed

Header parameter names are converted to lower case by proxy #65

ctornau opened this issue Sep 28, 2015 · 4 comments

Comments

@ctornau
Copy link

ctornau commented Sep 28, 2015

Our internal server ran into problems when it experienced that all parameter names of the HTTP header have been converted to lower case by the proxy. More precisely: The first letter is converted to lower case. A direct request is handled correctly by our server, because it can read the header names as expected. The proxy request is different because the parameters are now lower case:

Direct request:

Http-Header Accept=text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
Http-Header Accept-Encoding=gzip, deflate
Http-Header Accept-Language=de,en-US;q=0.7,en;q=0.3
Http-Header Cache-Control=max-age=0
Http-Header Connection=keep-alive
Http-Header Host=136.XXX.XXX.XXX:6600
Http-Header User-Agent=Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0

Via Proxy:

Http-Header X-Forwarded-For=194.xxx.xxx.xxx
Http-Header accept=text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
Http-Header accept-encoding=gzip, deflate
Http-Header accept-language=de,en-US;q=0.7,en;q=0.3
Http-Header cache-control=max-age=0
Http-Header host=127.0.0.1:6601
Http-Header user-agent=Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0

Is this a bug or is this specific to the library which is used? Are the parameter names of the HTTP protocol case sensitive?

@dsmiley
Copy link
Collaborator

dsmiley commented Sep 29, 2015

Hmmm. HttpClient's code (comments) states that headers names are case-insensitive. So it shouldn't matter. That said, I don't think the proxy should be altering the case of the headers. Looking through the proxy I don't see any lower-casing going on. I just added to the test to assert it finds the request headers in the same case. Maybe the servlet container you use is doing it?

@ctornau
Copy link
Author

ctornau commented Sep 29, 2015

Yes, you are right. We are using Apache Tomcat 7.0 as servlet container. This container seems to convert all header names to lower case. The header names are already lower case when returned by the method servletRequest.getHeaderNames() to your code.

Sorry for bothering you. This seems to be a Tomcat issue.

@ctornau
Copy link
Author

ctornau commented Sep 29, 2015

I submitted this as a Tomcat Bug: https://bz.apache.org/bugzilla/show_bug.cgi?id=58464

@ctornau ctornau closed this as completed Sep 29, 2015
@ctornau
Copy link
Author

ctornau commented Oct 16, 2015

Apache team has changed the bug to WONTFIX: https://bz.apache.org/bugzilla/show_bug.cgi?id=58464

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

No branches or pull requests

2 participants