commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Lubke <Ryan.Lu...@Sun.COM>
Subject [HttpClient] Host header handling...again
Date Thu, 29 Aug 2002 15:23:48 GMT
The current behavior where HttpClient will send an empty Host
request-header if the target resource is identified by
an IP address may need to be reworked.  

Given the folloing:

GET / HTTP/1.0

Against tomcat will yield a redirect to index.jsp, however
the Location header will look like this:  
   Location: http:///index.jsp

This will cause the redirection logic to fail.

After looking at the packets a browser sends, no matter
how the target resource is identified, hostname or IP address,
the Host request-header will be populated with that information of the

I guess the proper thing to do would be send a non-empty
Host request-header if strict mode is disabled.  Of course
in strict mode, the user's mileage will vary.

I then have a question about strict mode philosophy.  Should
strict mode be enabled by default or only in the cases
where it is expressly requested by the developer using the 
libraries?  If disabled by default, the library should
work 'out of the box' with most server implementations.
Sure, it's only one flag, but it's one less thing a 
developer has to deal with.

Just a thought.

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message