mirror of
https://github.com/curl/curl.git
synced 2026-08-25 13:03:37 +03:00
cookie: allow loading cookies for localhost
The added code to avoid loading PSL cookies from files from PR #22500
(c041895, not shipped in a release), calls psl_is_public_suffix(),
returns TRUE also for "localhost" (!).
We now allow cookies again for localhost. Added test 320 to verify.
Reported-by: Athos Ribeiro
Fixes #22645
Closes #22646
This commit is contained in:
parent
8770c49de4
commit
85c8f6f3a5
3 changed files with 68 additions and 5 deletions
12
lib/cookie.c
12
lib/cookie.c
|
|
@ -839,10 +839,14 @@ static bool is_public_suffix(struct Curl_easy *data,
|
|||
lcase[dlen] = 0;
|
||||
acceptable = psl_is_cookie_domain_acceptable(psl, lcase, lcookie);
|
||||
}
|
||||
else
|
||||
/* note that this PSL function returns the opposite value than
|
||||
psl_is_cookie_domain_acceptable() does */
|
||||
acceptable = !psl_is_public_suffix(psl, lcookie);
|
||||
else {
|
||||
/* libpsl says localhost is a PSL, we think not */
|
||||
acceptable =
|
||||
curl_strequal(lcookie, "localhost") ||
|
||||
/* note that this PSL function returns the opposite value than
|
||||
psl_is_cookie_domain_acceptable() does */
|
||||
!psl_is_public_suffix(psl, lcookie);
|
||||
}
|
||||
Curl_psl_release(data);
|
||||
}
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue