diff --git a/netwerk/cookie/CookieService.cpp b/netwerk/cookie/CookieService.cpp index 26512fc254b7..83125110dc24 100644 --- a/netwerk/cookie/CookieService.cpp +++ b/netwerk/cookie/CookieService.cpp @@ -1699,12 +1699,6 @@ bool CookieService::CheckDomain(CookieStruct& aCookieData, nsIURI* aHostURI, nsAutoCString hostFromURI; aHostURI->GetAsciiHost(hostFromURI); - // IPv6 fixup - if (hostFromURI.Contains(':')) { - hostFromURI.Insert("[", 0); - hostFromURI.Append(']'); - } - // if a domain is given, check the host has permission if (!aCookieData.host().IsEmpty()) { // Tolerate leading '.' characters, but not if it's otherwise an empty host. diff --git a/netwerk/test/unit/test_cookie_ipv6.js b/netwerk/test/unit/test_cookie_ipv6.js deleted file mode 100644 index 90234e1be44c..000000000000 --- a/netwerk/test/unit/test_cookie_ipv6.js +++ /dev/null @@ -1,52 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* - * Test that channels with different LoadInfo - * are stored in separate namespaces ("cookie jars") - */ - -"use strict"; - -let ip = "[::1]"; -XPCOMUtils.defineLazyGetter(this, "URL", function() { - return `http://${ip}:${httpserver.identity.primaryPort}/`; -}); - -const { HttpServer } = ChromeUtils.import("resource://testing-common/httpd.js"); - -let httpserver = new HttpServer(); - -function cookieSetHandler(metadata, response) { - response.setStatusLine(metadata.httpVersion, 200, "Ok"); - response.setHeader( - "Set-Cookie", - `Set-Cookie: T1=T2; path=/; SameSite=Lax; domain=${ip}; httponly`, - false - ); - response.setHeader("Content-Type", "text/html"); - response.setHeader("Content-Length", "2"); - response.bodyOutputStream.write("Ok", "Ok".length); -} - -add_task(async function test_cookie_ipv6() { - Services.prefs.setIntPref("network.cookie.cookieBehavior", 0); - Services.prefs.setBoolPref( - "network.cookieJarSettings.unblocked_for_testing", - true - ); - - httpserver.registerPathHandler("/", cookieSetHandler); - httpserver._start(-1, ip); - - var chan = NetUtil.newChannel({ - uri: URL, - loadUsingSystemPrincipal: true, - }); - let req = await new Promise(resolve => { - chan.asyncOpen(new ChannelListener(resolve)); - }); - var cm = Cc["@mozilla.org/cookiemanager;1"].getService(Ci.nsICookieManager); - equal(cm.cookies.length, 1); -}); diff --git a/netwerk/test/unit/xpcshell.ini b/netwerk/test/unit/xpcshell.ini index a9ff7063ca1a..62cdef7ac8c8 100644 --- a/netwerk/test/unit/xpcshell.ini +++ b/netwerk/test/unit/xpcshell.ini @@ -462,4 +462,3 @@ skip-if = os == "android" skip-if = os == "android" [test_httpssvc_priority.js] skip-if = os == "android" -[test_cookie_ipv6.js]