Skip to content
This repository has been archived by the owner on Jun 17, 2022. It is now read-only.

Commit

Permalink
Domain match blacklist
Browse files Browse the repository at this point in the history
  • Loading branch information
kspearrin committed Dec 7, 2018
1 parent 1da72b9 commit 9283a29
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/services/cipher.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ const Keys = {
neverDomains: 'neverDomains',
};

const DomainMatchBlacklist = new Map<string, Set<string>>([
['google.com', new Set(['script.google.com'])],
]);

export class CipherService implements CipherServiceAbstraction {
// tslint:disable-next-line
_decryptedCipherCache: CipherView[];
Expand Down Expand Up @@ -352,7 +356,14 @@ export class CipherService implements CipherServiceAbstraction {
case undefined:
case UriMatchType.Domain:
if (domain != null && u.domain != null && matchingDomains.indexOf(u.domain) > -1) {
return true;
if (DomainMatchBlacklist.has(u.domain)) {
const domainUrlHost = Utils.getHost(url);
if (!DomainMatchBlacklist.get(u.domain).has(domainUrlHost)) {
return true;
}
} else {
return true;
}
}
break;
case UriMatchType.Host:
Expand Down

0 comments on commit 9283a29

Please sign in to comment.