Skip to content
This repository was archived by the owner on Sep 9, 2022. It is now read-only.

Commit

Permalink
this fixes #1134
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Mar 31, 2015
1 parent 99a0d28 commit cd76d79
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/js/dynamic-net-filtering.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,11 @@ var is3rdParty = function(srcHostname, desHostname) {
}
var srcDomain = domainFromHostname(srcHostname);
if ( srcDomain === '' ) {
srcDomain = desHostname;
if ( srcHostname !== '' ) {
srcDomain = srcHostname;
} else {
srcDomain = desHostname;
}
}
if ( desHostname.slice(0 - srcDomain.length) !== srcDomain ) {
return true;
Expand Down
6 changes: 3 additions & 3 deletions src/js/pagestore.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,8 @@ NetFilteringResultCache.prototype.pruneAsyncCallback = function() {

/******************************************************************************/

NetFilteringResultCache.prototype.lookup = function(url) {
return this.urls[url];
NetFilteringResultCache.prototype.lookup = function(context) {
return this.urls[context.requestType + ' ' + context.requestURL];
};

/******************************************************************************/
Expand Down Expand Up @@ -645,7 +645,7 @@ PageStore.prototype.filterRequest = function(context) {
return '';
}

var entry = this.netFilteringCache.lookup(context.requestURL);
var entry = this.netFilteringCache.lookup(context);
if ( entry !== undefined ) {
//console.debug('cache HIT: PageStore.filterRequest("%s")', context.requestURL);
return entry.result;
Expand Down

0 comments on commit cd76d79

Please # to comment.