mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 05:11:16 +00:00
Bug 1724473 - Added an if statement at the bailout, enabling it to only work when the url starts with an alphanumeric. r=mak Bonardo <mbonardo@mozilla.com>
ran eslint to correct an error compressed the if statements into 1 if using && wrote a test in the test_URIFixup_info.js file fixed the test Differential Revision: https://phabricator.services.mozilla.com/D129634
This commit is contained in:
parent
09b489fe8a
commit
3eaed4ffa9
@ -663,11 +663,12 @@ function checkAndFixPublicSuffix(info) {
|
||||
|
||||
// Quick bailouts for most common cases, according to Alexa Top 1 million.
|
||||
if (
|
||||
asciiHost.endsWith(".com") ||
|
||||
asciiHost.endsWith(".net") ||
|
||||
asciiHost.endsWith(".org") ||
|
||||
asciiHost.endsWith(".ru") ||
|
||||
asciiHost.endsWith(".de")
|
||||
/^\w/.test(asciiHost) &&
|
||||
(asciiHost.endsWith(".com") ||
|
||||
asciiHost.endsWith(".net") ||
|
||||
asciiHost.endsWith(".org") ||
|
||||
asciiHost.endsWith(".ru") ||
|
||||
asciiHost.endsWith(".de"))
|
||||
) {
|
||||
return {
|
||||
suffix: asciiHost.substring(asciiHost.lastIndexOf(".") + 1),
|
||||
|
@ -508,6 +508,14 @@ var testcases = [
|
||||
input: "?'.com",
|
||||
keywordLookup: true,
|
||||
},
|
||||
{
|
||||
input: ".com",
|
||||
keywordLookup: true,
|
||||
affectedByDNSForSingleWordHosts: true,
|
||||
fixedURI: "http://.com/",
|
||||
alternateURI: "https://www.com/",
|
||||
protocolChange: true,
|
||||
},
|
||||
{
|
||||
input: "' ?.com",
|
||||
keywordLookup: true,
|
||||
|
Loading…
Reference in New Issue
Block a user