Bladeren bron

Fix parsing tlds. Fixes #74

pull/77/head
brantje 2 jaren geleden
bovenliggende
commit
0843fc4fa3
No account linked to committer's email address
6 gewijzigde bestanden met toevoegingen van 744 en 264 verwijderingen
  1. 2
    0
      js/lib/data/tlds.js
  2. 31
    0
      js/lib/parseTLD.js
  3. 3
    8
      js/lib/parseUrl.js
  4. 2
    0
      karma.conf.js
  5. 2
    0
      manifest.json
  6. 704
    256
      tests/unit/lib/parseUrl.js

+ 2
- 0
js/lib/data/tlds.js
Diff onderdrukt omdat het te groot bestand
Bestand weergeven


+ 31
- 0
js/lib/parseTLD.js Bestand weergeven

@@ -0,0 +1,31 @@
var parse_host = function(host){
if(!tlds){
throw new Error('No TLDs!');
}

var parts = host.split(".");
var stack = "";
var tld_level = 1; //unknown tld are 1st level
for(var i=parts.length-1, part;i>=0;i--){
part = parts[i];
stack = stack ? part + "." + stack : part;
if(!tlds[stack]){
break;
}
tld_level = tlds[stack];
}
if(parts.length <= tld_level ) {
return {
tld: null,
domain: host
};
} else {
return {
tld : parts.slice(-tld_level).join('.'),
domain : parts.slice(-tld_level-1).join('.'),
sub : parts.slice(0, (-tld_level-1)).join('.'),
};
}


};

+ 3
- 8
js/lib/parseUrl.js Bestand weergeven

@@ -50,14 +50,9 @@ function processURL(URL, ignoreProtocol, ignoreSubdomain, ignorePath, ignorePort
baseHost = host;
}
else {
var result = host.match(/[^./]+\.[^./]+$/); // catch the two last parts, it's de hostname and the tld
//@TODO Implement known list of TLDs
//@url https://github.com/131/node-tld/blob/master/effective_tld_names.json

if(result) {
baseHost = result[0];
} else {
baseHost = host;
var tld = parse_host(host);
if(tld) {
baseHost = tld.domain;
}
}
var returnURL = "";

+ 2
- 0
karma.conf.js Bestand weergeven

@@ -19,6 +19,8 @@ module.exports = function (config) {

// list of files / patterns to load in the browser
files: [
'js/lib/data/tlds.js',
'js/lib/parseTLD.js',
'js/lib/parseUrl.js',
{ pattern: 'tests/**/*.js', included: true }
],

+ 2
- 0
manifest.json Bestand weergeven

@@ -20,6 +20,8 @@
"background": {
"scripts": [
"/js/vendor/jquery/jquery.js",
"/js/lib/data/tlds.js",
"/js/lib/parseTLD.js",
"/js/lib/parseUrl.js",
"/js/vendor/sjcl/sjcl.js",
"/js/lib/promise.js",

+ 704
- 256
tests/unit/lib/parseUrl.js Bestand weergeven

@@ -1343,901 +1343,1349 @@ var testCombinations = [{
"ignorePort": false,
"expected": "https://subdomain.example.com/page/login"
}, {
"url": "http://192.168.1.1",
"url": "http://example.com.br",
"ignoreProtocol": true,
"ignoreSubdomain": true,
"ignorePath": true,
"ignorePort": true,
"expected": "192.168.1.1"
"expected": "example.com.br"
}, {
"url": "http://192.168.1.1",
"url": "http://example.com.br",
"ignoreProtocol": true,
"ignoreSubdomain": true,
"ignorePath": true,
"ignorePort": false,
"expected": "192.168.1.1"
"expected": "example.com.br"
}, {
"url": "http://192.168.1.1",
"url": "http://example.com.br",
"ignoreProtocol": true,
"ignoreSubdomain": true,
"ignorePath": false,
"ignorePort": true,
"expected": "192.168.1.1"
"expected": "example.com.br"
}, {
"url": "http://192.168.1.1",
"url": "http://example.com.br",
"ignoreProtocol": true,
"ignoreSubdomain": true,
"ignorePath": false,
"ignorePort": false,
"expected": "192.168.1.1"
"expected": "example.com.br"
}, {
"url": "http://192.168.1.1",
"url": "http://example.com.br",
"ignoreProtocol": true,
"ignoreSubdomain": false,
"ignorePath": true,
"ignorePort": true,
"expected": "192.168.1.1"
"expected": "example.com.br"
}, {
"url": "http://192.168.1.1",
"url": "http://example.com.br",
"ignoreProtocol": true,
"ignoreSubdomain": false,
"ignorePath": true,
"ignorePort": false,
"expected": "192.168.1.1"
"expected": "example.com.br"
}, {
"url": "http://192.168.1.1",
"url": "http://example.com.br",
"ignoreProtocol": true,
"ignoreSubdomain": false,
"ignorePath": false,
"ignorePort": true,
"expected": "192.168.1.1"
"expected": "example.com.br"
}, {
"url": "http://192.168.1.1",
"url": "http://example.com.br",
"ignoreProtocol": true,
"ignoreSubdomain": false,
"ignorePath": false,
"ignorePort": false,
"expected": "192.168.1.1"
"expected": "example.com.br"
}, {
"url": "http://192.168.1.1",
"url": "http://example.com.br",
"ignoreProtocol": false,
"ignoreSubdomain": true,
"ignorePath": true,
"ignorePort": true,
"expected": "http://192.168.1.1"
"expected": "http://example.com.br"
}, {
"url": "http://192.168.1.1",
"url": "http://example.com.br",
"ignoreProtocol": false,
"ignoreSubdomain": true,
"ignorePath": true,
"ignorePort": false,
"expected": "http://192.168.1.1"
"expected": "http://example.com.br"
}, {
"url": "http://192.168.1.1",
"url": "http://example.com.br",
"ignoreProtocol": false,
"ignoreSubdomain": true,
"ignorePath": false,
"ignorePort": true,
"expected": "http://192.168.1.1"
"expected": "http://example.com.br"
}, {
"url": "http://192.168.1.1",
"url": "http://example.com.br",
"ignoreProtocol": false,
"ignoreSubdomain": true,
"ignorePath": false,
"ignorePort": false,
"expected": "http://192.168.1.1"
"expected": "http://example.com.br"
}, {
"url": "http://192.168.1.1",
"url": "http://example.com.br",
"ignoreProtocol": false,
"ignoreSubdomain": false,
"ignorePath": true,
"ignorePort": true,
"expected": "http://192.168.1.1"
"expected": "http://example.com.br"
}, {
"url": "http://192.168.1.1",
"url": "http://example.com.br",
"ignoreProtocol": false,
"ignoreSubdomain": false,
"ignorePath": true,
"ignorePort": false,
"expected": "http://192.168.1.1"
"expected": "http://example.com.br"
}, {
"url": "http://192.168.1.1",
"url": "http://example.com.br",
"ignoreProtocol": false,
"ignoreSubdomain": false,
"ignorePath": false,
"ignorePort": true,
"expected": "http://192.168.1.1"
"expected": "http://example.com.br"
}, {
"url": "http://192.168.1.1",
"url": "http://example.com.br",
"ignoreProtocol": false,
"ignoreSubdomain": false,
"ignorePath": false,
"ignorePort": false,
"expected": "http://192.168.1.1"
"expected": "http://example.com.br"
}, {
"url": "http://192.168.1.1:8080",
"url": "http://example.com.br:8080",
"ignoreProtocol": true,
"ignoreSubdomain": true,
"ignorePath": true,
"ignorePort": true,
"expected": "192.168.1.1"
"expected": "example.com.br"
}, {
"url": "http://192.168.1.1:8080",
"url": "http://example.com.br:8080",
"ignoreProtocol": true,
"ignoreSubdomain": true,
"ignorePath": true,
"ignorePort": false,
"expected": "192.168.1.1:8080"
"expected": "example.com.br:8080"
}, {
"url": "http://192.168.1.1:8080",
"url": "http://example.com.br:8080",
"ignoreProtocol": true,
"ignoreSubdomain": true,
"ignorePath": false,
"ignorePort": true,
"expected": "192.168.1.1"
"expected": "example.com.br"
}, {
"url": "http://192.168.1.1:8080",
"url": "http://example.com.br:8080",
"ignoreProtocol": true,
"ignoreSubdomain": true,
"ignorePath": false,
"ignorePort": false,
"expected": "192.168.1.1:8080"
"expected": "example.com.br:8080"
}, {
"url": "http://192.168.1.1:8080",
"url": "http://example.com.br:8080",
"ignoreProtocol": true,
"ignoreSubdomain": false,
"ignorePath": true,
"ignorePort": true,
"expected": "192.168.1.1"
"expected": "example.com.br"
}, {
"url": "http://192.168.1.1:8080",
"url": "http://example.com.br:8080",
"ignoreProtocol": true,
"ignoreSubdomain": false,
"ignorePath": true,
"ignorePort": false,
"expected": "192.168.1.1:8080"
"expected": "example.com.br:8080"
}, {
"url": "http://192.168.1.1:8080",
"url": "http://example.com.br:8080",
"ignoreProtocol": true,
"ignoreSubdomain": false,
"ignorePath": false,
"ignorePort": true,
"expected": "192.168.1.1"
"expected": "example.com.br"
}, {
"url": "http://192.168.1.1:8080",
"url": "http://example.com.br:8080",
"ignoreProtocol": true,
"ignoreSubdomain": false,
"ignorePath": false,
"ignorePort": false,
"expected": "192.168.1.1:8080"
"expected": "example.com.br:8080"
}, {
"url": "http://192.168.1.1:8080",
"url": "http://example.com.br:8080",
"ignoreProtocol": false,
"ignoreSubdomain": true,
"ignorePath": true,
"ignorePort": true,
"expected": "http://192.168.1.1"
"expected": "http://example.com.br"
}, {
"url": "http://192.168.1.1:8080",
"url": "http://example.com.br:8080",
"ignoreProtocol": false,
"ignoreSubdomain": true,
"ignorePath": true,
"ignorePort": false,
"expected": "http://192.168.1.1:8080"
"expected": "http://example.com.br:8080"
}, {
"url": "http://192.168.1.1:8080",
"url": "http://example.com.br:8080",
"ignoreProtocol": false,
"ignoreSubdomain": true,
"ignorePath": false,
"ignorePort": true,
"expected": "http://192.168.1.1"
"expected": "http://example.com.br"
}, {
"url": "http://192.168.1.1:8080",
"url": "http://example.com.br:8080",
"ignoreProtocol": false,
"ignoreSubdomain": true,
"ignorePath": false,
"ignorePort": false,
"expected": "http://192.168.1.1:8080"
"expected": "http://example.com.br:8080"
}, {
"url": "http://192.168.1.1:8080",
"url": "http://example.com.br:8080",
"ignoreProtocol": false,
"ignoreSubdomain": false,
"ignorePath": true,
"ignorePort": true,
"expected": "http://192.168.1.1"
"expected": "http://example.com.br"
}, {
"url": "http://192.168.1.1:8080",
"url": "http://example.com.br:8080",
"ignoreProtocol": false,
"ignoreSubdomain": false,
"ignorePath": true,
"ignorePort": false,
"expected": "http://192.168.1.1:8080"
"expected": "http://example.com.br:8080"
}, {
"url": "http://192.168.1.1:8080",
"url": "http://example.com.br:8080",
"ignoreProtocol": false,
"ignoreSubdomain": false,
"ignorePath": false,
"ignorePort": true,
"expected": "http://192.168.1.1"
"expected": "http://example.com.br"
}, {
"url": "http://192.168.1.1:8080",
"url": "http://example.com.br:8080",
"ignoreProtocol": false,
"ignoreSubdomain": false,
"ignorePath": false,
"ignorePort": false,
"expected": "http://192.168.1.1:8080"
"expected": "http://example.com.br:8080"
}, {
"url": "https://192.168.1.1:8080",
"url": "https://example.com.br:8080",
"ignoreProtocol": true,
"ignoreSubdomain": true,
"ignorePath": true,
"ignorePort": true,
"expected": "192.168.1.1"
"expected": "example.com.br"
}, {
"url": "https://192.168.1.1:8080",
"url": "https://example.com.br:8080",
"ignoreProtocol": true,
"ignoreSubdomain": true,
"ignorePath": true,
"ignorePort": false,
"expected": "192.168.1.1:8080"
"expected": "example.com.br:8080"
}, {
"url": "https://192.168.1.1:8080",
"url": "https://example.com.br:8080",
"ignoreProtocol": true,
"ignoreSubdomain": true,
"ignorePath": false,
"ignorePort": true,
"expected": "192.168.1.1"
"expected": "example.com.br"
}, {
"url": "https://192.168.1.1:8080",
"url": "https://example.com.br:8080",
"ignoreProtocol": true,
"ignoreSubdomain": true,
"ignorePath": false,
"ignorePort": false,
"expected": "192.168.1.1:8080"
"expected": "example.com.br:8080"
}, {
"url": "https://192.168.1.1:8080",
"url": "https://example.com.br:8080",
"ignoreProtocol": true,
"ignoreSubdomain": false,
"ignorePath": true,
"ignorePort": true,
"expected": "192.168.1.1"
"expected": "example.com.br"
}, {
"url": "https://192.168.1.1:8080",
"url": "https://example.com.br:8080",
"ignoreProtocol": true,
"ignoreSubdomain": false,
"ignorePath": true,
"ignorePort": false,
"expected": "192.168.1.1:8080"
"expected": "example.com.br:8080"
}, {
"url": "https://192.168.1.1:8080",
"url": "https://example.com.br:8080",
"ignoreProtocol": true,
"ignoreSubdomain": false,
"ignorePath": false,
"ignorePort": true,
"expected": "192.168.1.1"
"expected": "example.com.br"
}, {
"url": "https://192.168.1.1:8080",
"url": "https://example.com.br:8080",
"ignoreProtocol": true,
"ignoreSubdomain": false,
"ignorePath": false,
"ignorePort": false,
"expected": "192.168.1.1:8080"
"expected": "example.com.br:8080"
}, {
"url": "https://192.168.1.1:8080",
"url": "https://example.com.br:8080",
"ignoreProtocol": false,
"ignoreSubdomain": true,
"ignorePath": true,
"ignorePort": true,
"expected": "https://192.168.1.1"
"expected": "https://example.com.br"
}, {
"url": "https://192.168.1.1:8080",
"url": "https://example.com.br:8080",
"ignoreProtocol": false,
"ignoreSubdomain": true,
"ignorePath": true,
"ignorePort": false,
"expected": "https://192.168.1.1:8080"
"expected": "https://example.com.br:8080"
}, {
"url": "https://192.168.1.1:8080",
"url": "https://example.com.br:8080",
"ignoreProtocol": false,
"ignoreSubdomain": true,
"ignorePath": false,
"ignorePort": true,
"expected": "https://192.168.1.1"
"expected": "https://example.com.br"
}, {
"url": "https://192.168.1.1:8080",
"url": "https://example.com.br:8080",
"ignoreProtocol": false,
"ignoreSubdomain": true,
"ignorePath": false,
"ignorePort": false,
"expected": "https://192.168.1.1:8080"
"expected": "https://example.com.br:8080"
}, {
"url": "https://192.168.1.1:8080",
"url": "https://example.com.br:8080",
"ignoreProtocol": false,
"ignoreSubdomain": false,
"ignorePath": true,
"ignorePort": true,
"expected": "https://192.168.1.1"
"expected": "https://example.com.br"
}, {
"url": "https://192.168.1.1:8080",
"url": "https://example.com.br:8080",
"ignoreProtocol": false,
"ignoreSubdomain": false,
"ignorePath": true,
"ignorePort": false,
"expected": "https://192.168.1.1:8080"
"expected": "https://example.com.br:8080"
}, {
"url": "https://192.168.1.1:8080",
"url": "https://example.com.br:8080",
"ignoreProtocol": false,
"ignoreSubdomain": false,
"ignorePath": false,
"ignorePort": true,
"expected": "https://192.168.1.1"
"expected": "https://example.com.br"
}, {
"url": "https://192.168.1.1:8080",
"url": "https://example.com.br:8080",
"ignoreProtocol": false,
"ignoreSubdomain": false,
"ignorePath": false,
"ignorePort": false,
"expected": "https://192.168.1.1:8080"
"expected": "https://example.com.br:8080"
}, {
"url": "https://192.168.1.1.com",
"url": "https://example.com.br",
"ignoreProtocol": true,
"ignoreSubdomain": true,
"ignorePath": true,
"ignorePort": true,
"expected": "1.com"
"expected": "example.com.br"
}, {
"url": "https://192.168.1.1.com",
"url": "https://example.com.br",
"ignoreProtocol": true,
"ignoreSubdomain": true,
"ignorePath": true,
"ignorePort": false,
"expected": "1.com"
"expected": "example.com.br"
}, {
"url": "https://192.168.1.1.com",
"url": "https://example.com.br",
"ignoreProtocol": true,
"ignoreSubdomain": true,
"ignorePath": false,
"ignorePort": true,
"expected": "1.com"
"expected": "example.com.br"
}, {
"url": "https://192.168.1.1.com",
"url": "https://example.com.br",
"ignoreProtocol": true,
"ignoreSubdomain": true,
"ignorePath": false,
"ignorePort": false,
"expected": "1.com"
"expected": "example.com.br"
}, {
"url": "https://192.168.1.1.com",
"url": "https://example.com.br",
"ignoreProtocol": true,
"ignoreSubdomain": false,
"ignorePath": true,
"ignorePort": true,
"expected": "192.168.1.1.com"
"expected": "example.com.br"
}, {
"url": "https://192.168.1.1.com",
"url": "https://example.com.br",
"ignoreProtocol": true,
"ignoreSubdomain": false,
"ignorePath": true,
"ignorePort": false,
"expected": "192.168.1.1.com"
"expected": "example.com.br"
}, {
"url": "https://192.168.1.1.com",
"url": "https://example.com.br",
"ignoreProtocol": true,
"ignoreSubdomain": false,
"ignorePath": false,
"ignorePort": true,
"expected": "192.168.1.1.com"
"expected": "example.com.br"
}, {
"url": "https://192.168.1.1.com",
"url": "https://example.com.br",
"ignoreProtocol": true,
"ignoreSubdomain": false,
"ignorePath": false,
"ignorePort": false,
"expected": "192.168.1.1.com"
"expected": "example.com.br"
}, {
"url": "https://192.168.1.1.com",
"url": "https://example.com.br",
"ignoreProtocol": false,
"ignoreSubdomain": true,
"ignorePath": true,
"ignorePort": true,
"expected": "https://1.com"
"expected": "https://example.com.br"
}, {
"url": "https://192.168.1.1.com",
"url": "https://example.com.br",
"ignoreProtocol": false,
"ignoreSubdomain": true,
"ignorePath": true,
"ignorePort": false,
"expected": "https://1.com"
"expected": "https://example.com.br"
}, {
"url": "https://192.168.1.1.com",
"url": "https://example.com.br",
"ignoreProtocol": false,
"ignoreSubdomain": true,
"ignorePath": false,
"ignorePort": true,
"expected": "https://1.com"
"expected": "https://example.com.br"
}, {
"url": "https://192.168.1.1.com",
"url": "https://example.com.br",
"ignoreProtocol": false,
"ignoreSubdomain": true,
"ignorePath": false,
"ignorePort": false,
"expected": "https://1.com"
"expected": "https://example.com.br"
}, {
"url": "https://192.168.1.1.com",
"url": "https://example.com.br",
"ignoreProtocol": false,
"ignoreSubdomain": false,
"ignorePath": true,
"ignorePort": true,
"expected": "https://192.168.1.1.com"
"expected": "https://example.com.br"
}, {
"url": "https://192.168.1.1.com",
"url": "https://example.com.br",
"ignoreProtocol": false,
"ignoreSubdomain": false,
"ignorePath": true,
"ignorePort": false,
"expected": "https://192.168.1.1.com"
"expected": "https://example.com.br"
}, {
"url": "https://192.168.1.1.com",
"url": "https://example.com.br",
"ignoreProtocol": false,
"ignoreSubdomain": false,
"ignorePath": false,
"ignorePort": true,
"expected": "https://192.168.1.1.com"
"expected": "https://example.com.br"
}, {
"url": "https://192.168.1.1.com",
"url": "https://example.com.br",
"ignoreProtocol": false,
"ignoreSubdomain": false,
"ignorePath": false,
"ignorePort": false,
"expected": "https://192.168.1.1.com"
"expected": "https://example.com.br"
}, {
"url": "http://192.168.1.1/page/login",
"url": "http://subdomain.example.com.br",
"ignoreProtocol": true,
"ignoreSubdomain": true,
"ignorePath": true,
"ignorePort": true,
"expected": "192.168.1.1"
"expected": "example.com.br"
}, {
"url": "http://192.168.1.1/page/login",
"url": "http://subdomain.example.com.br",
"ignoreProtocol": true,
"ignoreSubdomain": true,
"ignorePath": true,
"ignorePort": false,
"expected": "192.168.1.1"
"expected": "example.com.br"
}, {
"url": "http://192.168.1.1/page/login",
"url": "http://subdomain.example.com.br",
"ignoreProtocol": true,
"ignoreSubdomain": true,
"ignorePath": false,
"ignorePort": true,
"expected": "192.168.1.1/page/login"
"expected": "example.com.br"
}, {
"url": "http://192.168.1.1/page/login",
"url": "http://subdomain.example.com.br",
"ignoreProtocol": true,
"ignoreSubdomain": true,
"ignorePath": false,
"ignorePort": false,
"expected": "192.168.1.1/page/login"
"expected": "example.com.br"
}, {
"url": "http://192.168.1.1/page/login",
"url": "http://subdomain.example.com.br",
"ignoreProtocol": true,
"ignoreSubdomain": false,
"ignorePath": true,
"ignorePort": true,
"expected": "192.168.1.1"
"expected": "subdomain.example.com.br"
}, {
"url": "http://192.168.1.1/page/login",
"url": "http://subdomain.example.com.br",
"ignoreProtocol": true,
"ignoreSubdomain": false,
"ignorePath": true,
"ignorePort": false,
"expected": "192.168.1.1"
"expected": "subdomain.example.com.br"
}, {
"url": "http://192.168.1.1/page/login",
"url": "http://subdomain.example.com.br",
"ignoreProtocol": true,
"ignoreSubdomain": false,
"ignorePath": false,
"ignorePort": true,
"expected": "192.168.1.1/page/login"
"expected": "subdomain.example.com.br"
}, {
"url": "http://192.168.1.1/page/login",
"url": "http://subdomain.example.com.br",
"ignoreProtocol": true,
"ignoreSubdomain": false,
"ignorePath": false,
"ignorePort": false,
"expected": "192.168.1.1/page/login"
"expected": "subdomain.example.com.br"
}, {
"url": "http://192.168.1.1/page/login",
"url": "http://subdomain.example.com.br",
"ignoreProtocol": false,
"ignoreSubdomain": true,
"ignorePath": true,
"ignorePort": true,
"expected": "http://192.168.1.1"
"expected": "http://example.com.br"
}, {
"url": "http://192.168.1.1/page/login",
"url": "http://subdomain.example.com.br",
"ignoreProtocol": false,
"ignoreSubdomain": true,
"ignorePath": true,
"ignorePort": false,
"expected": "http://192.168.1.1"
"expected": "http://example.com.br"
}, {
"url": "http://192.168.1.1/page/login",
"url": "http://subdomain.example.com.br",
"ignoreProtocol": false,
"ignoreSubdomain": true,
"ignorePath": false,
"ignorePort": true,
"expected": "http://192.168.1.1/page/login"
"expected": "http://example.com.br"
}, {
"url": "http://192.168.1.1/page/login",
"url": "http://subdomain.example.com.br",
"ignoreProtocol": false,
"ignoreSubdomain": true,
"ignorePath": false,
"ignorePort": false,
"expected": "http://192.168.1.1/page/login"
"expected": "http://example.com.br"
}, {
"url": "http://192.168.1.1/page/login",
"url": "http://subdomain.example.com.br",
"ignoreProtocol": false,
"ignoreSubdomain": false,
"ignorePath": true,
"ignorePort": true,
"expected": "http://192.168.1.1"
"expected": "http://subdomain.example.com.br"
}, {
"url": "http://192.168.1.1/page/login",
"url": "http://subdomain.example.com.br",
"ignoreProtocol": false,
"ignoreSubdomain": false,
"ignorePath": true,
"ignorePort": false,
"expected": "http://192.168.1.1"
"expected": "http://subdomain.example.com.br"
}, {
"url": "http://192.168.1.1/page/login",
"url": "http://subdomain.example.com.br",
"ignoreProtocol": false,
"ignoreSubdomain": false,
"ignorePath": false,
"ignorePort": true,
"expected": "http://192.168.1.1/page/login"
"expected": "http://subdomain.example.com.br"
}, {
"url": "http://192.168.1.1/page/login",
"url": "http://subdomain.example.com.br",
"ignoreProtocol": false,
"ignoreSubdomain": false,
"ignorePath": false,
"ignorePort": false,
"expected": "http://192.168.1.1/page/login"
"expected": "http://subdomain.example.com.br"
}, {
"url": "http://192.168.1.1:8080/page/login",
"url": "http://subdomain.example.com.br:8080",
"ignoreProtocol": true,
"ignoreSubdomain": true,
"ignorePath": true,
"ignorePort": true,
"expected": "192.168.1.1"
"expected": "example.com.br"
}, {
"url": "http://192.168.1.1:8080/page/login",
"url": "http://subdomain.example.com.br:8080",
"ignoreProtocol": true,
"ignoreSubdomain": true,
"ignorePath": true,
"ignorePort": false,
"expected": "192.168.1.1:8080"
"expected": "example.com.br:8080"
}, {
"url": "http://192.168.1.1:8080/page/login",
"url": "http://subdomain.example.com.br:8080",
"ignoreProtocol": true,
"ignoreSubdomain": true,
"ignorePath": false,
"ignorePort": true,
"expected": "192.168.1.1/page/login"
"expected": "example.com.br"
}, {
"url": "http://192.168.1.1:8080/page/login",
"url": "http://subdomain.example.com.br:8080",
"ignoreProtocol": true,
"ignoreSubdomain": true,
"ignorePath": false,
"ignorePort": false,
"expected": "192.168.1.1:8080/page/login"
"expected": "example.com.br:8080"
}, {
"url": "http://192.168.1.1:8080/page/login",
"url": "http://subdomain.example.com.br:8080",
"ignoreProtocol": true,
"ignoreSubdomain": false,
"ignorePath": true,
"ignorePort": true,
"expected": "192.168.1.1"
"expected": "subdomain.example.com.br"
}, {
"url": "http://192.168.1.1:8080/page/login",
"url": "http://subdomain.example.com.br:8080",
"ignoreProtocol": true,
"ignoreSubdomain": false,
"ignorePath": true,
"ignorePort": false,
"expected": "192.168.1.1:8080"
"expected": "subdomain.example.com.br:8080"
}, {
"url": "http://192.168.1.1:8080/page/login",
"url": "http://subdomain.example.com.br:8080",
"ignoreProtocol": true,
"ignoreSubdomain": false,
"ignorePath": false,
"ignorePort": true,
"expected": "192.168.1.1/page/login"
"expected": "subdomain.example.com.br"
}, {
"url": "http://192.168.1.1:8080/page/login",
"url": "http://subdomain.example.com.br:8080",
"ignoreProtocol": true,
"ignoreSubdomain": false,
"ignorePath": false,
"ignorePort": false,
"expected": "192.168.1.1:8080/page/login"
"expected": "subdomain.example.com.br:8080"
}, {
"url": "http://192.168.1.1:8080/page/login",
"url": "http://subdomain.example.com.br:8080",
"ignoreProtocol": false,
"ignoreSubdomain": true,
"ignorePath": true,
"ignorePort": true,
"expected": "http://192.168.1.1"
"expected": "http://example.com.br"
}, {
"url": "http://192.168.1.1:8080/page/login",
"url": "http://subdomain.example.com.br:8080",
"ignoreProtocol": false,
"ignoreSubdomain": true,
"ignorePath": true,
"ignorePort": false,
"expected": "http://192.168.1.1:8080"
"expected": "http://example.com.br:8080"
}, {
"url": "http://192.168.1.1:8080/page/login",
"url": "http://subdomain.example.com.br:8080",
"ignoreProtocol": false,
"ignoreSubdomain": true,
"ignorePath": false,
"ignorePort": true,
"expected": "http://192.168.1.1/page/login"
"expected": "http://example.com.br"
}, {
"url": "http://192.168.1.1:8080/page/login",
"url": "http://subdomain.example.com.br:8080",
"ignoreProtocol": false,
"ignoreSubdomain": true,
"ignorePath": false,
"ignorePort": false,
"expected": "http://192.168.1.1:8080/page/login"
"expected": "http://example.com.br:8080"
}, {
"url": "http://192.168.1.1:8080/page/login",
"url": "http://subdomain.example.com.br:8080",
"ignoreProtocol": false,
"ignoreSubdomain": false,
"ignorePath": true,
"ignorePort": true,
"expected": "http://192.168.1.1"
"expected": "http://subdomain.example.com.br"
}, {
"url": "http://192.168.1.1:8080/page/login",
"url": "http://subdomain.example.com.br:8080",
"ignoreProtocol": false,
"ignoreSubdomain": false,
"ignorePath": true,
"ignorePort": false,
"expected": "http://192.168.1.1:8080"
"expected": "http://subdomain.example.com.br:8080"
}, {
"url": "http://192.168.1.1:8080/page/login",
"url": "http://subdomain.example.com.br:8080",
"ignoreProtocol": false,
"ignoreSubdomain": false,
"ignorePath": false,
"ignorePort": true,
"expected": "http://192.168.1.1/page/login"
"expected": "http://subdomain.example.com.br"
}, {
"url": "http://192.168.1.1:8080/page/login",
"url": "http://subdomain.example.com.br:8080",
"ignoreProtocol": false,
"ignoreSubdomain": false,
"ignorePath": false,
"ignorePort": false,
"expected": "http://192.168.1.1:8080/page/login"
"expected": "http://subdomain.example.com.br:8080"
}, {
"url": "https://192.168.1.1:8080/page/login",
"url": "https://subdomain.example.com.br:8080",
"ignoreProtocol": true,
"ignoreSubdomain": true,
"ignorePath": true,
"ignorePort": true,
"expected": "192.168.1.1"
"expected": "example.com.br"
}, {
"url": "https://192.168.1.1:8080/page/login",
"url": "https://subdomain.example.com.br:8080",
"ignoreProtocol": true,
"ignoreSubdomain": true,
"ignorePath": true,
"ignorePort": false,
"expected": "192.168.1.1:8080"
"expected": "example.com.br:8080"
}, {
"url": "https://192.168.1.1:8080/page/login",
"url": "https://subdomain.example.com.br:8080",
"ignoreProtocol": true,
"ignoreSubdomain": true,
"ignorePath": false,
"ignorePort": true,
"expected": "192.168.1.1/page/login"
"expected": "example.com.br"
}, {
"url": "https://192.168.1.1:8080/page/login",
"url": "https://subdomain.example.com.br:8080",
"ignoreProtocol": true,
"ignoreSubdomain": true,
"ignorePath": false,
"ignorePort": false,
"expected": "192.168.1.1:8080/page/login"
"expected": "example.com.br:8080"
}, {
"url": "https://192.168.1.1:8080/page/login",
"url": "https://subdomain.example.com.br:8080",
"ignoreProtocol": true,
"ignoreSubdomain": false,
"ignorePath": true,
"ignorePort": true,
"expected": "192.168.1.1"
"expected": "subdomain.example.com.br"
}, {
"url": "https://192.168.1.1:8080/page/login",
"url": "https://subdomain.example.com.br:8080",
"ignoreProtocol": true,
"ignoreSubdomain": false,
"ignorePath": true,
"ignorePort": false,
"expected": "192.168.1.1:8080"
"expected": "subdomain.example.com.br:8080"
}, {
"url": "https://192.168.1.1:8080/page/login",
"url": "https://subdomain.example.com.br:8080",
"ignoreProtocol": true,
"ignoreSubdomain": false,
"ignorePath": false,
"ignorePort": true,
"expected": "192.168.1.1/page/login"
"expected": "subdomain.example.com.br"
}, {
"url": "https://192.168.1.1:8080/page/login",
"url": "https://subdomain.example.com.br:8080",
"ignoreProtocol": true,
"ignoreSubdomain": false,
"ignorePath": false,
"ignorePort": false,
"expected": "192.168.1.1:8080/page/login"
"expected": "subdomain.example.com.br:8080"
}, {
"url": "https://192.168.1.1:8080/page/login",
"url": "https://subdomain.example.com.br:8080",
"ignoreProtocol": false,
"ignoreSubdomain": true,
"ignorePath": true,
"ignorePort": true,
"expected": "https://192.168.1.1"
"expected": "https://example.com.br"
}, {
"url": "https://192.168.1.1:8080/page/login",
"url": "https://subdomain.example.com.br:8080",
"ignoreProtocol": false,
"ignoreSubdomain": true,
"ignorePath": true,
"ignorePort": false,
"expected": "https://192.168.1.1:8080"
"expected": "https://example.com.br:8080"
}, {
"url": "https://192.168.1.1:8080/page/login",
"url": "https://subdomain.example.com.br:8080",
"ignoreProtocol": false,
"ignoreSubdomain": true,
"ignorePath": false,
"ignorePort": true,
"expected": "https://192.168.1.1/page/login"
"expected": "https://example.com.br"
}, {
"url": "https://192.168.1.1:8080/page/login",
"url": "https://subdomain.example.com.br:8080",
"ignoreProtocol": false,
"ignoreSubdomain": true,
"ignorePath": false,
"ignorePort": false,
"expected": "https://192.168.1.1:8080/page/login"
"expected": "https://example.com.br:8080"
}, {
"url": "https://192.168.1.1:8080/page/login",
"url": "https://subdomain.example.com.br:8080",
"ignoreProtocol": false,
"ignoreSubdomain": false,
"ignorePath": true,
"ignorePort": true,
"expected": "https://192.168.1.1"
"expected": "https://subdomain.example.com.br"
}, {
"url": "https://192.168.1.1:8080/page/login",
"url": "https://subdomain.example.com.br:8080",
"ignoreProtocol": false,
"ignoreSubdomain": false,
"ignorePath": true,
"ignorePort": false,
"expected": "https://192.168.1.1:8080"
"expected": "https://subdomain.example.com.br:8080"
}, {
"url": "https://192.168.1.1:8080/page/login",
"url": "https://subdomain.example.com.br:8080",
"ignoreProtocol": false,
"ignoreSubdomain": false,
"ignorePath": false,
"ignorePort": true,
"expected": "https://192.168.1.1/page/login"
"expected": "https://subdomain.example.com.br"
}, {
"url": "https://192.168.1.1:8080/page/login",
"url": "https://subdomain.example.com.br:8080",
"ignoreProtocol": false,
"ignoreSubdomain": false,
"ignorePath": false,
"ignorePort": false,
"expected": "https://192.168.1.1:8080/page/login"
"expected": "https://subdomain.example.com.br:8080"
}, {
"url": "https://192.168.1.1/page/login",
"url": "https://subdomain.example.com.br",
"ignoreProtocol": true,
"ignoreSubdomain": true,
"ignorePath": true,
"ignorePort": true,
"expected": "192.168.1.1"
"expected": "example.com.br"
}, {
"url": "https://192.168.1.1/page/login",
"url": "https://subdomain.example.com.br",
"ignoreProtocol": true,
"ignoreSubdomain": true,
"ignorePath": true,
"ignorePort": false,
"expected": "192.168.1.1"
"expected": "example.com.br"
}, {
"url": "https://192.168.1.1/page/login",
"url": "https://subdomain.example.com.br",
"ignoreProtocol": true,
"ignoreSubdomain": true,
"ignorePath": false,
"ignorePort": true,
"expected": "192.168.1.1/page/login"
"expected": "example.com.br"
}, {
"url": "https://192.168.1.1/page/login",
"url": "https://subdomain.example.com.br",
"ignoreProtocol": true,
"ignoreSubdomain": true,
"ignorePath": false,
"ignorePort": false,
"expected": "192.168.1.1/page/login"
"expected": "example.com.br"
}, {
"url": "https://192.168.1.1/page/login",
"url": "https://subdomain.example.com.br",
"ignoreProtocol": true,
"ignoreSubdomain": false,
"ignorePath": true,
"ignorePort": true,
"expected": "192.168.1.1"
"expected": "subdomain.example.com.br"
}, {
"url": "https://192.168.1.1/page/login",
"url": "https://subdomain.example.com.br",
"ignoreProtocol": true,
"ignoreSubdomain": false,
"ignorePath": true,
"ignorePort": false,
"expected": "192.168.1.1"
"expected": "subdomain.example.com.br"
}, {
"url": "https://192.168.1.1/page/login",
"url": "https://subdomain.example.com.br",
"ignoreProtocol": true,
"ignoreSubdomain": false,
"ignorePath": false,
"ignorePort": true,
"expected": "192.168.1.1/page/login"
"expected": "subdomain.example.com.br"
}, {
"url": "https://192.168.1.1/page/login",
"url": "https://subdomain.example.com.br",
"ignoreProtocol": true,
"ignoreSubdomain": false,
"ignorePath": false,
"ignorePort": false,
"expected": "192.168.1.1/page/login"
"expected": "subdomain.example.com.br"
}, {
"url": "https://192.168.1.1/page/login",
"url": "https://subdomain.example.com.br",
"ignoreProtocol": false,
"ignoreSubdomain": true,
"ignorePath": true,
"ignorePort": true,
"expected": "https://192.168.1.1"
"expected": "https://example.com.br"
}, {
"url": "https://192.168.1.1/page/login",
"url": "https://subdomain.example.com.br",
"ignoreProtocol": false,
"ignoreSubdomain": true,
"ignorePath": true,
"ignorePort": false,
"expected": "https://192.168.1.1"
"expected": "https://example.com.br"
}, {
"url": "https://192.168.1.1/page/login",
"url": "https://subdomain.example.com.br",
"ignoreProtocol": false,
"ignoreSubdomain": true,
"ignorePath": false,
"ignorePort": true,
"expected": "https://192.168.1.1/page/login"
"expected": "https://example.com.br"
}, {
"url": "https://192.168.1.1/page/login",
"url": "https://subdomain.example.com.br",
"ignoreProtocol": false,
"ignoreSubdomain": true,
"ignorePath": false,
"ignorePort": false,
"expected": "https://192.168.1.1/page/login"
"expected": "https://example.com.br"
}, {
"url": "https://192.168.1.1/page/login",
"url": "https://subdomain.example.com.br",
"ignoreProtocol": false,
"ignoreSubdomain": false,
"ignorePath": true,
"ignorePort": true,
"expected": "https://192.168.1.1"
"expected": "https://subdomain.example.com.br"
}, {
"url": "https://192.168.1.1/page/login",
"url": "https://subdomain.example.com.br",
"ignoreProtocol": false,
"ignoreSubdomain": false,
"ignorePath": true,
"ignorePort": false,
"expected": "https://192.168.1.1"
"expected": "https://subdomain.example.com.br"
}, {
"url": "https://192.168.1.1/page/login",
"url": "https://subdomain.example.com.br",
"ignoreProtocol": false,
"ignoreSubdomain": false,
"ignorePath": false,
"ignorePort": true,
"expected": "https://192.168.1.1/page/login"
"expected": "https://subdomain.example.com.br"
}, {
"url": "https://192.168.1.1/page/login",
"url": "https://subdomain.example.com.br",
"ignoreProtocol": false,
"ignoreSubdomain": false,
"ignorePath": false,
"ignorePort": false,
"expected": "https://192.168.1.1/page/login"
"expected": "https://subdomain.example.com.br"
}, {
"url": "http://subdomain.example.com.br/page/login",
"ignoreProtocol": true,
"ignoreSubdomain": true,
"ignorePath": true,
"ignorePort": true,
"expected": "example.com.br"
}, {
"url": "http://subdomain.example.com.br/page/login",
"ignoreProtocol": true,
"ignoreSubdomain": true,
"ignorePath": true,
"ignorePort": false,
"expected": "example.com.br"
}, {
"url": "http://subdomain.example.com.br/page/login",
"ignoreProtocol": true,
"ignoreSubdomain": true,
"ignorePath": false,
"ignorePort": true,
"expected": "example.com.br/page/login"
}, {
"url": "http://subdomain.example.com.br/page/login",
"ignoreProtocol": true,
"ignoreSubdomain": true,
"ignorePath": false,
"ignorePort": false,
"expected": "example.com.br/page/login"
}, {
"url": "http://subdomain.example.com.br/page/login",
"ignoreProtocol": true,
"ignoreSubdomain": false,
"ignorePath": true,
"ignorePort": true,
"expected": "subdomain.example.com.br"
}, {
"url": "http://subdomain.example.com.br/page/login",
"ignoreProtocol": true,
"ignoreSubdomain": false,
"ignorePath": true,
"ignorePort": false,
"expected": "subdomain.example.com.br"
}, {
"url": "http://subdomain.example.com.br/page/login",
"ignoreProtocol": true,
"ignoreSubdomain": false,
"ignorePath": false,
"ignorePort": true,
"expected": "subdomain.example.com.br/page/login"
}, {
"url": "http://subdomain.example.com.br/page/login",
"ignoreProtocol": true,
"ignoreSubdomain": false,
"ignorePath": false,
"ignorePort": false,
"expected": "subdomain.example.com.br/page/login"
}, {
"url": "http://subdomain.example.com.br/page/login",
"ignoreProtocol": false,
"ignoreSubdomain": true,
"ignorePath": true,
"ignorePort": true,
"expected": "http://example.com.br"
}, {
"url": "http://subdomain.example.com.br/page/login",
"ignoreProtocol": false,
"ignoreSubdomain": true,
"ignorePath": true,
"ignorePort": false,
"expected": "http://example.com.br"
}, {
"url": "http://subdomain.example.com.br/page/login",
"ignoreProtocol": false,
"ignoreSubdomain": true,
"ignorePath": false,
"ignorePort": true,
"expected": "http://example.com.br/page/login"
}, {
"url": "http://subdomain.example.com.br/page/login",
"ignoreProtocol": false,
"ignoreSubdomain": true,
"ignorePath": false,
"ignorePort": false,
"expected": "http://example.com.br/page/login"
}, {
"url": "http://subdomain.example.com.br/page/login",
"ignoreProtocol": false,
"ignoreSubdomain": false,
"ignorePath": true,
"ignorePort": true,
"expected": "http://subdomain.example.com.br"
}, {
"url": "http://subdomain.example.com.br/page/login",
"ignoreProtocol": false,
"ignoreSubdomain": false,
"ignorePath": true,
"ignorePort": false,
"expected": "http://subdomain.example.com.br"
}, {
"url": "http://subdomain.example.com.br/page/login",
"ignoreProtocol": false,
"ignoreSubdomain": false,
"ignorePath": false,
"ignorePort": true,
"expected": "http://subdomain.example.com.br/page/login"
}, {
"url": "http://subdomain.example.com.br/page/login",
"ignoreProtocol": false,
"ignoreSubdomain": false,
"ignorePath": false,
"ignorePort": false,
"expected": "http://subdomain.example.com.br/page/login"
}, {
"url": "http://subdomain.example.com.br:8080/page/login",
"ignoreProtocol": true,
"ignoreSubdomain": true,
"ignorePath": true,
"ignorePort": true,
"expected": "example.com.br"
}, {
"url": "http://subdomain.example.com.br:8080/page/login",
"ignoreProtocol": true,
"ignoreSubdomain": true,
"ignorePath": true,
"ignorePort": false,
"expected": "example.com.br:8080"
}, {
"url": "http://subdomain.example.com.br:8080/page/login",
"ignoreProtocol": true,
"ignoreSubdomain": true,
"ignorePath": false,
"ignorePort": true,
"expected": "example.com.br/page/login"
}, {
"url": "http://subdomain.example.com.br:8080/page/login",
"ignoreProtocol": true,
"ignoreSubdomain": true,
"ignorePath": false,
"ignorePort": false,
"expected": "example.com.br:8080/page/login"
}, {
"url": "http://subdomain.example.com.br:8080/page/login",
"ignoreProtocol": true,
"ignoreSubdomain": false,
"ignorePath": true,
"ignorePort": true,
"expected": "subdomain.example.com.br"
}, {
"url": "http://subdomain.example.com.br:8080/page/login",
"ignoreProtocol": true,
"ignoreSubdomain": false,
"ignorePath": true,
"ignorePort": false,
"expected": "subdomain.example.com.br:8080"
}, {
"url": "http://subdomain.example.com.br:8080/page/login",
"ignoreProtocol": true,
"ignoreSubdomain": false,
"ignorePath": false,
"ignorePort": true,
"expected": "subdomain.example.com.br/page/login"
}, {
"url": "http://subdomain.example.com.br:8080/page/login",
"ignoreProtocol": true,
"ignoreSubdomain": false,
"ignorePath": false,
"ignorePort": false,
"expected": "subdomain.example.com.br:8080/page/login"
}, {
"url": "http://subdomain.example.com.br:8080/page/login",
"ignoreProtocol": false,
"ignoreSubdomain": true,
"ignorePath": true,
"ignorePort": true,
"expected": "http://example.com.br"
}, {
"url": "http://subdomain.example.com.br:8080/page/login",
"ignoreProtocol": false,
"ignoreSubdomain": true,
"ignorePath": true,
"ignorePort": false,
"expected": "http://example.com.br:8080"
}, {
"url": "http://subdomain.example.com.br:8080/page/login",
"ignoreProtocol": false,
"ignoreSubdomain": true,
"ignorePath": false,
"ignorePort": true,
"expected": "http://example.com.br/page/login"
}, {
"url": "http://subdomain.example.com.br:8080/page/login",
"ignoreProtocol": false,
"ignoreSubdomain": true,
"ignorePath": false,
"ignorePort": false,
"expected": "http://example.com.br:8080/page/login"
}, {
"url": "http://subdomain.example.com.br:8080/page/login",
"ignoreProtocol": false,
"ignoreSubdomain": false,
"ignorePath": true,
"ignorePort": true,
"expected": "http://subdomain.example.com.br"
}, {
"url": "http://subdomain.example.com.br:8080/page/login",
"ignoreProtocol": false,
"ignoreSubdomain": false,
"ignorePath": true,
"ignorePort": false,
"expected": "http://subdomain.example.com.br:8080"
}, {
"url": "http://subdomain.example.com.br:8080/page/login",
"ignoreProtocol": false,
"ignoreSubdomain": false,
"ignorePath": false,
"ignorePort": true,
"expected": "http://subdomain.example.com.br/page/login"
}, {
"url": "http://subdomain.example.com.br:8080/page/login",
"ignoreProtocol": false,
"ignoreSubdomain": false,
"ignorePath": false,
"ignorePort": false,
"expected": "http://subdomain.example.com.br:8080/page/login"
}, {
"url": "https://subdomain.example.com.br:8080/page/login",
"ignoreProtocol": true,
"ignoreSubdomain": true,
"ignorePath": true,
"ignorePort": true,
"expected": "example.com.br"
}, {
"url": "https://subdomain.example.com.br:8080/page/login",
"ignoreProtocol": true,
"ignoreSubdomain": true,
"ignorePath": true,
"ignorePort": false,
"expected": "example.com.br:8080"
}, {
"url": "https://subdomain.example.com.br:8080/page/login",
"ignoreProtocol": true,
"ignoreSubdomain": true,
"ignorePath": false,
"ignorePort": true,
"expected": "example.com.br/page/login"
}, {
"url": "https://subdomain.example.com.br:8080/page/login",
"ignoreProtocol": true,
"ignoreSubdomain": true,
"ignorePath": false,
"ignorePort": false,
"expected": "example.com.br:8080/page/login"
}, {
"url": "https://subdomain.example.com.br:8080/page/login",
"ignoreProtocol": true,
"ignoreSubdomain": false,
"ignorePath": true,
"ignorePort": true,
"expected": "subdomain.example.com.br"
}, {
"url": "https://subdomain.example.com.br:8080/page/login",
"ignoreProtocol": true,
"ignoreSubdomain": false,
"ignorePath": true,
"ignorePort": false,
"expected": "subdomain.example.com.br:8080"
}, {
"url": "https://subdomain.example.com.br:8080/page/login",
"ignoreProtocol": true,
"ignoreSubdomain": false,
"ignorePath": false,
"ignorePort": true,
"expected": "subdomain.example.com.br/page/login"
}, {
"url": "https://subdomain.example.com.br:8080/page/login",
"ignoreProtocol": true,
"ignoreSubdomain": false,
"ignorePath": false,
"ignorePort": false,
"expected": "subdomain.example.com.br:8080/page/login"
}, {
"url": "https://subdomain.example.com.br:8080/page/login",
"ignoreProtocol": false,
"ignoreSubdomain": true,
"ignorePath": true,
"ignorePort": true,
"expected": "https://example.com.br"
}, {
"url": "https://subdomain.example.com.br:8080/page/login",
"ignoreProtocol": false,
"ignoreSubdomain": true,
"ignorePath": true,
"ignorePort": false,
"expected": "https://example.com.br:8080"
}, {
"url": "https://subdomain.example.com.br:8080/page/login",
"ignoreProtocol": false,
"ignoreSubdomain": true,
"ignorePath": false,
"ignorePort": true,
"expected": "https://example.com.br/page/login"
}, {
"url": "https://subdomain.example.com.br:8080/page/login",
"ignoreProtocol": false,
"ignoreSubdomain": true,
"ignorePath": false,
"ignorePort": false,
"expected": "https://example.com.br:8080/page/login"
}, {
"url": "https://subdomain.example.com.br:8080/page/login",
"ignoreProtocol": false,
"ignoreSubdomain": false,
"ignorePath": true,
"ignorePort": true,
"expected": "https://subdomain.example.com.br"
}, {
"url": "https://subdomain.example.com.br:8080/page/login",
"ignoreProtocol": false,
"ignoreSubdomain": false,
"ignorePath": true,
"ignorePort": false,
"expected": "https://subdomain.example.com.br:8080"
}, {
"url": "https://subdomain.example.com.br:8080/page/login",
"ignoreProtocol": false,
"ignoreSubdomain": false,
"ignorePath": false,
"ignorePort": true,
"expected": "https://subdomain.example.com.br/page/login"
}, {
"url": "https://subdomain.example.com.br:8080/page/login",
"ignoreProtocol": false,
"ignoreSubdomain": false,
"ignorePath": false,
"ignorePort": false,
"expected": "https://subdomain.example.com.br:8080/page/login"
}, {
"url": "https://subdomain.example.com.br/page/login",
"ignoreProtocol": true,
"ignoreSubdomain": true,
"ignorePath": true,
"ignorePort": true,
"expected": "example.com.br"
}, {
"url": "https://subdomain.example.com.br/page/login",
"ignoreProtocol": true,
"ignoreSubdomain": true,
"ignorePath": true,
"ignorePort": false,
"expected": "example.com.br"
}, {
"url": "https://subdomain.example.com.br/page/login",
"ignoreProtocol": true,
"ignoreSubdomain": true,
"ignorePath": false,
"ignorePort": true,
"expected": "example.com.br/page/login"
}, {
"url": "https://subdomain.example.com.br/page/login",
"ignoreProtocol": true,
"ignoreSubdomain": true,
"ignorePath": false,
"ignorePort": false,
"expected": "example.com.br/page/login"
}, {
"url": "https://subdomain.example.com.br/page/login",
"ignoreProtocol": true,
"ignoreSubdomain": false,
"ignorePath": true,
"ignorePort": true,
"expected": "subdomain.example.com.br"
}, {
"url": "https://subdomain.example.com.br/page/login",
"ignoreProtocol": true,
"ignoreSubdomain": false,
"ignorePath": true,
"ignorePort": false,
"expected": "subdomain.example.com.br"
}, {
"url": "https://subdomain.example.com.br/page/login",
"ignoreProtocol": true,
"ignoreSubdomain": false,
"ignorePath": false,
"ignorePort": true,
"expected": "subdomain.example.com.br/page/login"
}, {
"url": "https://subdomain.example.com.br/page/login",
"ignoreProtocol": true,
"ignoreSubdomain": false,
"ignorePath": false,
"ignorePort": false,
"expected": "subdomain.example.com.br/page/login"
}, {
"url": "https://subdomain.example.com.br/page/login",
"ignoreProtocol": false,
"ignoreSubdomain": true,
"ignorePath": true,
"ignorePort": true,
"expected": "https://example.com.br"
}, {
"url": "https://subdomain.example.com.br/page/login",
"ignoreProtocol": false,
"ignoreSubdomain": true,
"ignorePath": true,
"ignorePort": false,
"expected": "https://example.com.br"
}, {
"url": "https://subdomain.example.com.br/page/login",
"ignoreProtocol": false,
"ignoreSubdomain": true,
"ignorePath": false,
"ignorePort": true,
"expected": "https://example.com.br/page/login"
}, {
"url": "https://subdomain.example.com.br/page/login",
"ignoreProtocol": false,
"ignoreSubdomain": true,
"ignorePath": false,
"ignorePort": false,
"expected": "https://example.com.br/page/login"
}, {
"url": "https://subdomain.example.com.br/page/login",
"ignoreProtocol": false,
"ignoreSubdomain": false,
"ignorePath": true,
"ignorePort": true,
"expected": "https://subdomain.example.com.br"
}, {
"url": "https://subdomain.example.com.br/page/login",
"ignoreProtocol": false,
"ignoreSubdomain": false,
"ignorePath": true,
"ignorePort": false,
"expected": "https://subdomain.example.com.br"
}, {
"url": "https://subdomain.example.com.br/page/login",
"ignoreProtocol": false,
"ignoreSubdomain": false,
"ignorePath": false,
"ignorePort": true,
"expected": "https://subdomain.example.com.br/page/login"
}, {
"url": "https://subdomain.example.com.br/page/login",
"ignoreProtocol": false,
"ignoreSubdomain": false,
"ignorePath": false,
"ignorePort": false,
"expected": "https://subdomain.example.com.br/page/login"
}];

describe('Testing url parser', function () {

Laden…
Annuleren
Opslaan