I have a Netty HTTP server, and am getting in requests that look like so:
https://someuser%40abc.com@server99.route1.abc.com/rest/of/path.xml
And waaay down in my handler, I have a DefaultHttpRequest object. Is there any way to get the ‘someuser%40abc.com’ from the URL? Do I have to hack something up to get it earlier and pass it down?
Since the ‘user’ part was missing in DefaultHttpRequest in Netty, I did try to debug the Nety HttpDecoder using sample Netty Snoop server :). When I connect to
http://someuser@localhost:8080/rest/pathusing Chrome/ wget, the HttpDecoder didn’t receive someuser part as a header to decode, so I checked further by taking a Wireshark captured HTTP request and that also didn’t have someuser part as a header.The reason is, HTTP clients support generic syntax of URI Scheme mostly, and they strip of user part and does not include as headers most of the time.(check Nadeem Douba’s answer for more details). If http client can send these parameters as user managed headers, they can be accessed using request.getHeader(“X-user-header”).