I sent a message to the list before which I got no response to so I'm trying
again with perhaps a more descriptive subject line and as well am including
more detail of my proposed solution.  I am volunteering to take care of the
task listed on the page at
http://jakarta.apache.org/commons/httpclient/status.html which lists, as an
action item:

        Cookie Ordering  Per RFC 2109, the cookies returned in a Cookie
header should be ordered so that the "better matches" (i.e., more specific
path/domain) come first. Currently no effort is made to do that.

I have actually already implemented a solution to this task.  The solution
consists of making the org.apache.commons.httpclient.Cookie object implement
the Comparator interface to compare cookies in the proper order and then
modifying the primary createCookieHeader() method to add the cookies to a
TreeSet (which implements SortedSet) as it finds that they match, then
retrieving them from the SortedSet in order to create the cookie header.
The solution also adds a private static RuleBasedCollator to be used as a
utility object by the compare method for comparison of domain names and
paths when all else is equal.  The solution consists of an 137-line patch to
src/org/apache/commons/httpclient/Cookie.java.  In addition I implemented a
JUnit test to make sure that the comparisons are performed correctly.  This
consists of a 89-line patch to
src/test/org/apache/commons/httpclient/TestCookie.java.

Both patches are attached as the output of "cvs diff -c file".  If there's a
particular format you'd like or options I should use with diff, let me know.

If I'm posting this to the wrong place or this has already been fixed by
someone else, also please let me know.

Thanks, hope this helps,
-
John

Attachment: Cookie.patch
Description: Binary data

Attachment: TestCookie.patch
Description: Binary data

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to