From ae14556114dcae29f679db7c15f0bc9b707bb89a Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Sun, 15 Apr 2018 07:29:18 +0200 Subject: moebius#130: URL parser - fix: don't allow empty host name https://github.com/MoonchildProductions/moebius/issues/130 --- docshell/test/unit/test_nsDefaultURIFixup_info.js | 6 ----- dom/html/test/test_bug558788-1.html | 5 ++-- dom/url/tests/test_url.html | 12 +++++++++ extensions/cookie/test/unit/test_bug526789.js | 12 --------- netwerk/base/nsStandardURL.cpp | 31 +++++++++++++++------- netwerk/test/unit/test_URIs.js | 24 ----------------- netwerk/test/unit/test_standardurl.js | 8 ++++++ .../tests/xpcshell/test_oauth_grant_client.js | 2 +- .../tests/xpcshell/test_profile_client.js | 2 +- .../meta/XMLHttpRequest/open-url-bogus.htm.ini | 11 -------- .../web-platform/meta/url/url-constructor.html.ini | 3 --- .../passwordmgr/test/unit/test_logins_search.js | 1 - toolkit/components/places/UnifiedComplete.js | 2 +- toolkit/components/places/nsNavHistory.cpp | 4 +++ 14 files changed, 51 insertions(+), 72 deletions(-) delete mode 100644 testing/web-platform/meta/XMLHttpRequest/open-url-bogus.htm.ini diff --git a/docshell/test/unit/test_nsDefaultURIFixup_info.js b/docshell/test/unit/test_nsDefaultURIFixup_info.js index 9e33ea484f..c606ac32ef 100644 --- a/docshell/test/unit/test_nsDefaultURIFixup_info.js +++ b/docshell/test/unit/test_nsDefaultURIFixup_info.js @@ -426,8 +426,6 @@ var testcases = [ { protocolChange: true, }, { input: "?'.com", - fixedURI: "http:///?%27.com", - alternateURI: "http://www..com/?%27.com", keywordLookup: true, protocolChange: true, }, { @@ -436,14 +434,10 @@ var testcases = [ { protocolChange: true }, { input: "?mozilla", - fixedURI: "http:///?mozilla", - alternateURI: "http://www..com/?mozilla", keywordLookup: true, protocolChange: true, }, { input: "??mozilla", - fixedURI: "http:///??mozilla", - alternateURI: "http://www..com/??mozilla", keywordLookup: true, protocolChange: true, }, { diff --git a/dom/html/test/test_bug558788-1.html b/dom/html/test/test_bug558788-1.html index 94b7a5f00e..4db61ed738 100644 --- a/dom/html/test/test_bug558788-1.html +++ b/dom/html/test/test_bug558788-1.html @@ -154,13 +154,14 @@ function checkInputURL() sendString("ttp://mozilla.org"); checkValidApplies(element); - for (var i=0; i<13; ++i) { + for (var i=0; i<10; ++i) { synthesizeKey("VK_BACK_SPACE", {}); checkValidApplies(element); } synthesizeKey("VK_BACK_SPACE", {}); - for (var i=0; i<4; ++i) { + // "http://" is now invalid + for (var i=0; i<7; ++i) { checkInvalidApplies(element); synthesizeKey("VK_BACK_SPACE", {}); } diff --git a/dom/url/tests/test_url.html b/dom/url/tests/test_url.html index d07a752bb4..73e75667d8 100644 --- a/dom/url/tests/test_url.html +++ b/dom/url/tests/test_url.html @@ -398,6 +398,18 @@ is(url.href, "scheme://tmp\\test"); + +