hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Juho Mäkinen <juho.maki...@gmail.com>
Subject Possible bug in NetscapeDraftSpec.java
Date Mon, 30 May 2005 09:34:03 GMT
Hello.

I'm using commons-httpclient-3.0-rc2 to get pages from a site which
uses cookies.
Unfortunately, the site sends cookies with different PATH= than where the page
(which sends the cookie) was requested.

I suppose that the correct way is to use NetscapeDraftSpec class instead of
CookieSpecBase.java, but I noticed that NetscapeDraftSpec.validate
calls CookieSpecBase.validate (here's a code snippet from
NetscapeDraftSpec.validate)

        LOG.trace("enterNetscapeDraftCookieProcessor "
            + "NetscapeDraftSpec.validate(Cookie)");
        // Perform generic validation
        super.validate(host, port, path, secure, cookie);

        // Perform Netscape Cookie draft specific validation
        if (host.indexOf(".") >= 0) {
           .......

The validation fails with the line "super.validate(...)" which calls
CookieSpecBase.validate.
I believe that the correct operation would NOT to use the
CookieSpecBase.validate
when using different (for example, in my case the NetscapeDraftSpec)
CookieSpec class.

Is it a bug or is it a feature that NetscapeDraftSpec.validate really
calls super.validate?
If it's a feature then I'm willing to create a patch which allows clear and easy
extension point to use custom CookieSpec class instead of the few
alternative classes
which are part of httpclient package.

 - Juho Mäkinen, juho.makinen@gmail.com

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


Mime
View raw message