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

Add an option to cancel a request #197

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

Always

Just for now

Force add explicitcancel option to imasdk

  • Loading branch information
bbondy committed Mar 16, 2019
commit 4b69670207a1f06b0d6806bfc9c9cd887dedfb58
@@ -18,7 +18,15 @@ const filterPredicateWithPossibleLogging = (rule, filterPredicate = I) => {
/**
* Mapping rule which reformats rules
*/
const mapRule = (rule) => rule
const mapRule = (rule) => {
if (rule == '||imasdk.googleapis.com^$third-party') {
This conversation was marked as resolved by bbondy

This comment has been minimized.

Copy link
@emerick

emerick Mar 19, 2019

Contributor

Should it be === here and below?

This comment has been minimized.

Copy link
@bbondy

bbondy Mar 19, 2019

Author Member

yep thx.

return '||imasdk.googleapis.com^$third-party,explicitcancel'
}
if (rule == '/ima3.js') {
return '/ima3.js$explicitcancel'
}
return rule
}

/**
* Given a list of inputs returns a filtered list of rules that should be used.
@@ -38,5 +38,10 @@ describe('filtering', function () {
const rules = '&ad_channel=\n&ad_classid=\n&ad_height=\n&ad_keyword='
assert(sanitizeABPInput(`${filteredOutRule}\n&ad_channel=\n${filteredOutRule}\n&ad_classid=\n&ad_height=\n&ad_keyword=`, predicate) === rules)
})
it('Converts ima list to add forcecancel option', function () {
const rule = '||imasdk.googleapis.com^$third-party'
const mapToRule = '||imasdk.googleapis.com^$third-party,explicitcancel'
assert.strictEqual(sanitizeABPInput(rule), mapToRule)
})
})
})
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.