-
Bug
-
Resolution: Done
-
Major
-
2.0.0.Beta1
-
None
As described here, the HttpServletRequest.getLocalAddr and HttpServletRequest.getLocalName may return different results in case that Forwarded header is present in the HTTP request.
Header value in request:
Forwarded=for=192.121.210.60:455;proto=https;by=203.0.113.43:777
What particular methods return in case of handler usage:
HttpServerExchange.getSourceAddress() = /192.121.210.60:455
HttpServerExchange.getRequestScheme() = https
HttpServerExchange.getDestinationAddress() = /203.0.113.43:777Those are correct.
Servlet case:
HttpServletRequest.getRemoteAddr() = 192.121.210.60
HttpServletRequest.getRemoteHost() = 192.121.210.60
HttpServletRequest.getRemotePort() = 455
HttpServletRequest.getScheme() = https
HttpServletRequest.getLocalName() = 203.0.113.43
HttpServletRequest.getLocalAddr() = 127.0.0.1
HttpServletRequest.getLocalPort() = 8080Values of getLocalName() and getLocalAddr() should be the same, IMHO.
- is related to
-
UNDERTOW-1282 HttpServletRequest.getLocalPort() returned value does not reflect value specified by Forwarded~by header
- Resolved