hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: Exposing Cookie processing code
Date Sun, 29 May 2011 22:11:57 GMT
On 28 May 2011 17:36, Oleg Kalnichevski <olegk@apache.org> wrote:
> On Fri, 2011-05-27 at 19:21 +0100, sebb wrote:
>> I'm considering updating JMeter to use the cookie handling from HC4.
>>
>> At present it uses the Commons HC 3.1 code, in particular it relies on
>> the method
>>
>> Cookie[] org.apache.commons.httpclient.cookie.CookieSpecBase.match(String
>> host, int port, String path, boolean secure, Cookie[] cookies)
>>
>> which extracts the relevant cookies from the the cookies array and
>> returns the matching cookies in path name order.
>>
>> There does not seem to be an equivalent method in HC4. As far as I can
>> tell, the cookie match handling is only present in the method
>>
>> void org.apache.http.client.protocol.RequestAddCookies.process(HttpRequest
>> request, HttpContext context)
>>
>> which is not particularly easy to use in isolation.
>>
>> For JMeter it would be useful if the code used to process the list of
>> cookie heaqders could be extracted into a public method, for example:
>>
>> List<Header> getCookieHeaders(CookieStore cookieStore, CookieOrigin
>> cookieOrigin, CookieSpec cookieSpec)
>>
>> This could then be used to generate the headers for the Java and HC3
>> implementations.
>>
>> Thoughts?
>>
>
> Hi Sebastian
>
> There is not really that much code and I suspect you might be better off
> just coping to JMeter the bits you need.

Yes, I could do that, but if the code ever needed to be changed then
it would have to be changed in two places...

> At the same feel free to
> extract that code to a separate class within HttpClient.

I was thinking of creating a public method in the existing class.

> Oleg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Mime
View raw message