mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-07 08:18:41 +09:00
Issue #2670 - Compute baseDomain when cookies are read from the database
baseDomain is used as a key for cookies in a hashmap. For cookie operations to work properly, the baseDomain generation must be reliable. This is, however, not the case, because the result can change by updates to the public suffix list (PSL). Since the stored baseDomain is not reliable, the value must be recomputed when the database is read. This causes a minor performance hit but is needed if we want to keep abreast of PSL changes without clobbering the cookies database. Resolves #2670
This commit is contained in:
parent
d935c4f54c
commit
2e1c487563
1 changed files with 10 additions and 2 deletions
|
|
@ -2607,8 +2607,16 @@ nsCookieService::Read()
|
|||
if (!hasResult)
|
||||
break;
|
||||
|
||||
// Make sure we haven't already read the data.
|
||||
stmt->GetUTF8String(IDX_BASE_DOMAIN, baseDomain);
|
||||
// IDX_BASE_DOMAIN cannot be used, because updates to the public suffix list
|
||||
// may invalidate the value of the stored baseDomain.
|
||||
stmt->GetUTF8String(IDX_HOST, host);
|
||||
|
||||
rv = GetBaseDomainFromHost(host, baseDomain);
|
||||
if (NS_FAILED(rv)) {
|
||||
COOKIE_LOGSTRING(LogLevel::Debug,
|
||||
("Read(): Ignoring invalid host '%s'", host.get()));
|
||||
continue;
|
||||
}
|
||||
|
||||
nsAutoCString suffix;
|
||||
NeckoOriginAttributes attrs;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue