Commit 8c639aaf authored by Gijs Kruitbosch's avatar Gijs Kruitbosch
Browse files

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

parent a004c88f
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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;
  }

+14 −1
Original line number Diff line number Diff line
@@ -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,