|[jetty-users] ProxyServlet X-Forwarded-Host header doesn't contain port|
I'm using the ProxyServlet and I found that the X-Forwarded-Host header that is added at line 491 only includes the server name information but not the port. The original Host header comes in as "foo.bar:10443" but the X-Forwarded-Host header goes out as "foo.bar". This causes a problem because the backend server, a Jetty instance with forwarded=true in the connector, gets incorrect port information from request.getServerPort(). This causes a problem in code that relies on the request information to generate redirects.
Using my own proxy implementation and sending X-Forwarded-Host: foo.bar:10433 I found that the backend Jetty instance properly picked up the forwarded host and port information.
So is there a specific reason why the ProxyServlet doesn't include the port? It seems like an error to drop it, especially if it is non-standard like in my situation.
| Mike Pilone | Software Architect, Distribution | mpilone@xxxxxxx | o: 202-513-2679 m: 703-969-7493
Back to the top