X-Forwaded-Host causes 400 (Bad Request) #520

Open
mmaki opened this Issue Mar 27, 2014 · 0 comments

Comments

Projects
None yet
2 participants

mmaki commented Mar 27, 2014

When doing a request to Riak with two X-Forwarded-Host-values (comma separated) with ports, I get a 400 (Bad Request).

curl -H "X-Forwarded-Host: test.com:80, test.com:80" http://test2.com:8098/riak/p-bucket/noimg.png
<html><head><title>400 Bad Request</title></head><body><h1>Bad Request</h1>Invalid Host<p><hr><address>mochiweb+webmachine web server</address></body></html>

However when doing the same request without ports, the requested image is served correctly:

curl -H "X-Forwarded-Host: test.com:80, test.com:80" http://test2.com:8098/riak/p-bucket/noimg.png
< binary output removed >

Version: 2.0.0-pre20. Also had same bug with 2.0.0-pre11.

I've now solved this by unsetting X-Forwarded-Host-header in Apache, which we use as a proxy.

@jonmeredith jonmeredith added this to the 2.1 milestone May 12, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment