commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul C. Bryan" <em...@pbryan.net>
Subject Re: Can't set User-Agent header
Date Mon, 07 Jan 2002 06:56:26 GMT
otisg@ivillage.com wrote:

 > I like recycle(), and it makes sense that some request headers are
 > reset (e.g. Host header), but it makes less sense to erase some
 > request headers that are likely to remain the same in subsequent URL
 > retrievals, such as the User-Agent header.
 >

> So how about this change to recycle() method in HttpMethodBase:

 >
 > [Example of retaining user-agent request header on recycle call].

I am opposed to keeping certain request headers around on recycle calls. 
I believe a call to recycle should result in a known, repeatable and 
easy-to-document state, similar if not identical to that of creating a 
new method instance.

Trying to decide on what constitutes "headers that are likely to remain 
the same in subsequent URL retrievals" is problematic, because this 
differs greatly from one application to the next. For example, if 
HttpClient is used in a proxy server, "User-Agent" would be that of the 
requesting client, and will differ on every single call.

I might be supportive of the ability to set default values whenever 
methods are created or recycled. For instance, something like a 
"setDefaultUserAgent" method. This is easier to use, document and test, 
IMHO.

Yours truly,

Paul C. Bryan <email@pbryan.net>
http://pbryan.net/


--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message