commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Lubke <Ryan.Lu...@sun.com>
Subject [Fwd: [HttpClient][PATCH] Correction to addHostRequestHeader + minor formatting cleanups]
Date Wed, 10 Jul 2002 18:17:11 GMT
Hello,

I've attached a patch to correct the addHostRequestHeader() method.

The method, as it currently stands, doesn't take into account the fact
that the request may be directed at a port other than 80. 

Additionally, if the value for the target host is an IP address, the
current logic will sent that value across in the Host header, where as,
the best I can tell, the 2616 states that if the host value is not
an Internet Hostname, then the value for the Host header should be
empty.

So the areas of note in the patch are changes to addHostRequestHeader(),
and a new private method, isIpAddress(String value).  

NOTE:  The check performed on the value could be considered weak.  All
it cares about is that there are 4 all-digit values separated by 3 '.'.
If there is a better way to do this, please let me know.

At any rate, I've tested this out and it seems to work OK.

-rl





Mime
View raw message