accept invalid "set-cookies" headers when "domainName == .hostName".

This commit is contained in:
Dai Sato
2006-12-10 10:53:22 +00:00
parent dd02a73fcf
commit 408c926802
2 changed files with 15 additions and 2 deletions

View File

@@ -1,3 +1,9 @@
2006-12-10 Hiroyuki Ito <ZXB01226@nifty.com>
* [w3m-dev 04159] Re: Is this mailing list still alive?
* cookie.c: accept invalid "set-cookies" headers
when "domainName == .hostName".
2006-12-10 noz
* [20051124052846@w3mbbs] LiveHTTPHeaders
@@ -8760,4 +8766,4 @@ a * [w3m-dev 03276] compile error on EWS4800
* release-0-2-1
* import w3m-0.2.1
$Id: ChangeLog,v 1.970 2006/12/10 10:49:23 inu Exp $
$Id: ChangeLog,v 1.971 2006/12/10 10:53:22 inu Exp $

View File

@@ -1,4 +1,4 @@
/* $Id: cookie.c,v 1.9 2003/09/26 17:59:51 ukai Exp $ */
/* $Id: cookie.c,v 1.10 2006/12/10 10:53:22 inu Exp $ */
/*
* References for version 0 cookie:
@@ -65,6 +65,13 @@ domain_match(char *host, char *domain)
if (domain[1] == '\0' || contain_no_dots(host, domain_p))
return domain_p;
}
/*
* special case for domainName = .hostName
* see nsCookieService.cpp in Firefox.
*/
else if (domain[0] == '.' && strcasecmp(host, &domain[1]) == 0) {
return host;
}
/* [RFC 2109] s. 2, cases 2, 3 */
else {
offset = (domain[0] != '.') ? 0 : strlen(host) - strlen(domain);