Browse Source

fixed bad test for 1st-party

pull/2/head
gorhill 10 years ago
parent
commit
cd7996fb7d
  1. 8
      src/js/matrix.js

8
src/js/matrix.js

@ -130,17 +130,11 @@ var extractFirstPartyDesDomain = function(srcHostname, desHostname) {
if ( srcHostname === '*' || desHostname === '*' || desHostname === '1st-party' ) {
return '';
}
var srcLength = srcHostname.length;
var desLength = desHostname.length;
var len = srcLength < desLength ? srcLength : desLength;
if ( srcHostname.slice(-len) !== desHostname.slice(-len) ) {
return '';
}
var desDomain = µm.URI.domainFromHostname(desHostname);
if ( desDomain === '' ) {
return '';
}
var pos = srcLength - desDomain.length;
var pos = srcHostname.length - desDomain.length;
if ( pos < 0 || srcHostname.slice(pos) !== desDomain ) {
return '';
}

Loading…
Cancel
Save