mirror of
https://github.com/curl/curl.git
synced 2025-02-17 14:59:45 +08:00
Revert "cookies: extend domain checks to non psl builds"
This reverts commit 3773de378d
.
Regression shipped in 7.64.0
Fixes #3649
This commit is contained in:
parent
76b6348949
commit
299d9660f8
15
lib/cookie.c
15
lib/cookie.c
@ -816,8 +816,6 @@ Curl_cookie_add(struct Curl_easy *data,
|
|||||||
co->domain = strdup(ptr);
|
co->domain = strdup(ptr);
|
||||||
if(!co->domain)
|
if(!co->domain)
|
||||||
badcookie = TRUE;
|
badcookie = TRUE;
|
||||||
else if(bad_domain(co->domain))
|
|
||||||
badcookie = TRUE;
|
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
/* This field got its explanation on the 23rd of May 2001 by
|
/* This field got its explanation on the 23rd of May 2001 by
|
||||||
@ -946,20 +944,18 @@ Curl_cookie_add(struct Curl_easy *data,
|
|||||||
if(!noexpire)
|
if(!noexpire)
|
||||||
remove_expired(c);
|
remove_expired(c);
|
||||||
|
|
||||||
if(domain && co->domain && !isip(co->domain)) {
|
|
||||||
int acceptable;
|
|
||||||
#ifdef USE_LIBPSL
|
#ifdef USE_LIBPSL
|
||||||
const psl_ctx_t *psl = Curl_psl_use(data);
|
|
||||||
|
|
||||||
/* Check if the domain is a Public Suffix and if yes, ignore the cookie. */
|
/* Check if the domain is a Public Suffix and if yes, ignore the cookie. */
|
||||||
|
if(domain && co->domain && !isip(co->domain)) {
|
||||||
|
const psl_ctx_t *psl = Curl_psl_use(data);
|
||||||
|
int acceptable;
|
||||||
|
|
||||||
if(psl) {
|
if(psl) {
|
||||||
acceptable = psl_is_cookie_domain_acceptable(psl, domain, co->domain);
|
acceptable = psl_is_cookie_domain_acceptable(psl, domain, co->domain);
|
||||||
Curl_psl_release(data);
|
Curl_psl_release(data);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
acceptable = !bad_domain(domain);
|
||||||
/* Without libpsl, do the best we can. */
|
|
||||||
acceptable = !bad_domain(co->domain);
|
|
||||||
|
|
||||||
if(!acceptable) {
|
if(!acceptable) {
|
||||||
infof(data, "cookie '%s' dropped, domain '%s' must not "
|
infof(data, "cookie '%s' dropped, domain '%s' must not "
|
||||||
@ -968,6 +964,7 @@ Curl_cookie_add(struct Curl_easy *data,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
myhash = cookiehash(co->domain);
|
myhash = cookiehash(co->domain);
|
||||||
clist = c->cookies[myhash];
|
clist = c->cookies[myhash];
|
||||||
|
@ -46,7 +46,6 @@ Set-Cookie: trailingspace = removed; path=/we/want;
|
|||||||
Set-Cookie: nocookie=yes; path=/WE;
|
Set-Cookie: nocookie=yes; path=/WE;
|
||||||
Set-Cookie: blexp=yesyes; domain=%HOSTIP; domain=%HOSTIP; expiry=totally bad;
|
Set-Cookie: blexp=yesyes; domain=%HOSTIP; domain=%HOSTIP; expiry=totally bad;
|
||||||
Set-Cookie: partialip=nono; domain=.0.0.1;
|
Set-Cookie: partialip=nono; domain=.0.0.1;
|
||||||
Set-Cookie: chocolate=chip; domain=curl; path=/we/want;
|
|
||||||
|
|
||||||
</file>
|
</file>
|
||||||
<precheck>
|
<precheck>
|
||||||
|
Loading…
Reference in New Issue
Block a user