jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geert Engels <ge...@inceptor.com>
Subject Cactus 1.5 and WebRequest.addCookie(String, String) ?
Date Mon, 26 Jan 2004 12:41:12 GMT

Hi,

I have been using Cactus-13-1.4.1 + httpclient (nightly drop from
21-04-2002) for a long time now, and been very happy with it.

Last week, I upgraded to Cactus-13-1.5 + httpclient 2.0RC3, and
noticed that some unit tests which have been working great for 6
months or more suddenly started failing consistently.

What all these tests have in common is that they depend on setting
cookies through WebRequest.addCookie(String, String).  Somehow the
cookies are no longer making it to the serverside instance of the
test.

I tried various things, including setting the cookie domain
explicitly, but no luck.

Switching on debug output for cactus and httpclient revealed that
httpclient no longer deemed the cookies worthy of transfer.

I added some extra debug code to httpclient, and was able to see that in
org.apache.commons.httpclient.cookie.CookieSpecBase.java:462, the method
with signature:

	public boolean match(String host, int port, String path, boolean
secure, final Cookie cookie)

returns false, contrary to my expectations.  More specifically, it is
the pathMatch portion of the test that fails.

In that pathMatch, the following are being compared:

	path={/cactus/ServletRedirector}
	cookie.getPath()={/cheap}

The "/cheap" is part of the request I'm trying to make, set up through
WebRequest.setURL().  But the "/cactus/ServletRedirector" part, is that
not something that is internal to Cactus and should be totally
transparent to my test code ?

In any event, I did not have this problem with prior cactus/httpclient
versions.

I went through the mailing list archives, but could find only one recent
reference to cookie problems, which was a question without reply:
http://www.mail-archive.com/cactus-user@jakarta.apache.org/msg04183.html

Any help would be very much appreciated.

Thanks,

Geert Engels.
VP of Product Development
Inceptor, Inc.



Mime
View raw message