hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Exposing Cookie processing code
Date Fri, 27 May 2011 18:21:11 GMT
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?

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


Mime
View raw message