hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: Exposing Cookie processing code
Date Sat, 28 May 2011 16:36:35 GMT
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. At the same feel free to
extract that code to a separate class within HttpClient.


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

View raw message