Browse Source

this fixes #283

pull/2/head
gorhill 10 years ago
parent
commit
3d3673f163
  1. 20
      src/js/matrix.js

20
src/js/matrix.js

@ -188,18 +188,10 @@ var extractFirstPartyDesDomain = function(srcHostname, desHostname) {
if ( srcHostname === '*' || desHostname === '*' || desHostname === '1st-party' ) { if ( srcHostname === '*' || desHostname === '*' || desHostname === '1st-party' ) {
return ''; return '';
} }
var desDomain = µm.URI.domainFromHostname(desHostname);
if ( desDomain === '' ) {
return '';
}
var pos = srcHostname.length - desDomain.length;
if ( pos < 0 || srcHostname.slice(pos) !== desDomain ) {
return '';
}
if ( pos !== 0 && srcHostname.charAt(pos - 1) !== '.' ) {
return '';
}
return desDomain;
var µmuri = µm.URI;
var srcDomain = µmuri.domainFromHostname(srcHostname) || srcHostname;
var desDomain = µmuri.domainFromHostname(desHostname) || desHostname;
return desDomain === srcDomain ? desDomain : '';
}; };
/******************************************************************************/ /******************************************************************************/
@ -441,8 +433,8 @@ Matrix.prototype.evaluateCellZXY = function(srcHostname, desHostname, type) {
} }
} }
// 1st-party specific-type cell: it's a special row, it exists only in
// global scope.
// 1st-party specific-type cell: it's a special row, looked up only
// when destination is 1st-party to source.
r = this.evaluateCellZ(srcHostname, '1st-party', type); r = this.evaluateCellZ(srcHostname, '1st-party', type);
if ( r === 1 ) { return Matrix.RedIndirect; } if ( r === 1 ) { return Matrix.RedIndirect; }
if ( r === 2 ) { return Matrix.GreenIndirect; } if ( r === 2 ) { return Matrix.GreenIndirect; }

Loading…
Cancel
Save