If I configure `proxy-address-forwarding` for my http-listener, reqeust.getServerName and request.getServerPort still return the hostname/port from the Host header in the request. I would expect if `proxy-address-forwarding` is configured that the Apache proxy's hostname/port would be returned.
I noticed that when I make a curl request with an empty Host header (like below) that the X-Forwarded-* headers are picked up by getServerName/getServerPort.
Whereas, if I set Host header to empty it works:
# curl -H "Host:" -H "X-Forwarded-Host:myhost" -H "X-Forwarded-Port: 80" http://localhost:8080/sample_proxynameport/hello.jsp request.getServerName() => myhost request.getServerPort() => 80 request.getScheme() => http
However, not having a Host header is bad HTTP/1.1 and in future Undertow release the "workaround" above will not work (UNDERTOW-786).
- clones
-
JBEAP-5669 [GSS](7.0.z) proxy-address-forwarding has not effect when Host header is present
- Verified
- is caused by
-
UNDERTOW-756 Redirect Location header ignores X-Forwarded-Host and X-Forwarded-Port but honours X-Forwarded-Proto
- Resolved
- is incorporated by
-
JBEAP-5669 [GSS](7.0.z) proxy-address-forwarding has not effect when Host header is present
- Verified