Skip to content
This repository has been archived by the owner. It is now read-only.

Fix deserialized host anchored domain only filter matching #193

Merged
merged 1 commit into from Mar 4, 2019
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Fix deserialized host anchored domain only filter matching

  • Loading branch information
bbondy committed Mar 4, 2019
commit e2015bbbd4690a5fc26c29e6b26ed4c6b527f115
@@ -87,6 +87,8 @@ uint32_t NoFingerprintDomain::Deserialize(char *buffer, uint32_t bufferSize) {
data = buffer + consumed;
consumed += dataLen;
borrowed_data = true;
// Since we serialize a \0 character, we need to skip past it.
consumed++;
return consumed;
}

@@ -71,6 +71,21 @@ describe('matching', function () {
assert.equal(this.client.getMatchingStats().numExceptionHashSetSaves, 1)
})
})
describe('domain only host anchored filters', function () {
before(function () {
this.client = new AdBlockClient()
this.client.parse('||imasdk.googleapis.com^$third-party\n@@||imasdk.googleapis.com/js/sdkloader/ima3.js$domain=cbc.ca|cbsnews.com|cbssports.com')
const data = this.client.serialize()
this.client2 = new AdBlockClient()
this.client2.deserialize(data)
})
it('should match exception filter from normal parsed list', function () {
assert(!this.client2.matches('https://imasdk.googleapis.com/js/sdkloader/ima3.js?v=1.0fc2a9c5e010611944b364a71d43c8b5099f209f', FilterOptions.script, 'www.cbsnews.com'))
})
it('should match exception filter from deserialized list', function () {
assert(!this.client.matches('https://imasdk.googleapis.com/js/sdkloader/ima3.js?v=1.0fc2a9c5e010611944b364a71d43c8b5099f209f', FilterOptions.script, 'www.cbsnews.com'))
})
})
describe('host anchored exception with not matching first party exception', function () {
before(function () {
this.client = new AdBlockClient()
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.