Bug 1719442 - stop doing alternate fixup for 'http' or 'https' strings as host names, r=mak

Differential Revision: https://phabricator.services.mozilla.com/D119391
This commit is contained in:
Gijs Kruitbosch 2021-07-09 12:49:54 +00:00
Родитель a004c88f02
Коммит 8c639aaff3
2 изменённых файлов: 17 добавлений и 2 удалений

Просмотреть файл

@ -764,7 +764,9 @@ function maybeSetAlternateFixedURI(info, fixupFlags) {
let oldHost = uri.host;
// Don't create an alternate uri for localhost, because it would be confusing.
if (oldHost == "localhost") {
// Ditto for 'http' and 'https' as these are frequently the result of typos, e.g.
// 'https//foo' (note missing : ).
if (oldHost == "localhost" || oldHost == "http" || oldHost == "https") {
return false;
}

Просмотреть файл

@ -565,6 +565,20 @@ var testcases = [
protocolChange: true,
affectedByDNSForSingleWordHosts: true,
},
{
input: "http",
fixedURI: "http://http/",
keywordLookup: true,
protocolChange: true,
affectedByDNSForSingleWordHosts: true,
},
{
input: "https",
fixedURI: "http://https/",
keywordLookup: true,
protocolChange: true,
affectedByDNSForSingleWordHosts: true,
},
{
input: "localhost:8080",
fixedURI: "http://localhost:8080/",
@ -652,7 +666,6 @@ var testcases = [
{
input: "http//mozilla.org",
fixedURI: "http://http//mozilla.org",
alternateURI: "https://www.http.com//mozilla.org",
keywordLookup: true,
protocolChange: true,
affectedByDNSForSingleWordHosts: true,