hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 35225] - CookieSpecBase.domainMatch() leaks cookies to 3rd party domains
Date Sun, 05 Jun 2005 08:15:48 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=35225>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=35225





------- Additional Comments From gojomo@archive.org  2005-06-05 10:15 -------
Previous suggestion fails to reproduce another behavior of IE6 (but not
Firefox1.0.4): a cookie of domain "example.com" (no leading dot) will be sent by
IE to subdomains, like "www.example.com" (but not unrelated domains like
"anotherexample.com"). 

To match IE, this should do the trick (without again ruling-in unrelated but
similar-ending domains): 

    public boolean domainMatch(final String host, final String domain) {
// EVEN BETTER (for mimicking IE): also sends "example.com" cookie to proper
subdomains like "www.example.com"
        return (domain.startsWith(".")) 
            ? (host.endsWith(domain) || host.equals(domain.substring(1)))
            : (host.equals(domain) || host.endsWith("."+domain));
    }

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
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