commit 368f63d711f0a174fa17abf25a5cbd152fd873af parent e820181a13a2ce686ed0166775ab9aa058c3c7cf Author: Randell Jesup <rjesup@mozilla.com> Date: Wed, 1 Oct 2025 18:46:03 +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(); }); },