commit f819cc68168879bb7addacc6a148250333bded7b parent b57869821b2e3f81089b8f20ae7ec4e989ee6b4b Author: Randell Jesup <rjesup@mozilla.com> Date: Tue, 7 Oct 2025 17:56:04 +0000 Bug 1984198: Fix for ipv6 clear by principal for Compression Dictionaries r=edgul Differential Revision: https://phabricator.services.mozilla.com/D266206 Diffstat:
| M | toolkit/components/cleardata/ClearDataService.sys.mjs | | | 13 | ++++++++++--- |
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/toolkit/components/cleardata/ClearDataService.sys.mjs b/toolkit/components/cleardata/ClearDataService.sys.mjs @@ -208,13 +208,20 @@ const CookieCleaner = { deleteByHost(aHost, aOriginAttributes) { return new Promise(aResolve => { - // Compression dictionaries are https only - let httpsURI = Services.io.newURI("https://" + aHost); - Services.cache2.clearOriginDictionary(httpsURI); Services.cookies.removeCookiesFromExactHost( aHost, JSON.stringify(aOriginAttributes) ); + // Compression dictionaries are https only + // Note that IPV6 urls require [...], but aPrincipal.host (passed + // to this) doesn't include the []. + if (aHost.includes(":") && aHost[0] != "[") { + aHost = "https://[" + aHost + "]"; + } else { + aHost = "https://" + aHost; + } + let httpsURI = Services.io.newURI(aHost); + Services.cache2.clearOriginDictionary(httpsURI); aResolve(); }); },