Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Fix hostPattern and don't apply migration if user has global block in…
Browse files Browse the repository at this point in the history
… place

Fixes #14204

Auditors: @diracdeltas
  • Loading branch information
bsclifton committed May 22, 2018
1 parent 1bfb422 commit 321b208
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions app/migrations/20180518_uphold.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ const compareVersions = require('compare-versions')
// per https://github.com/brave/browser-laptop/issues/14152
// add fingerprint exception for existing users for uphold.com
module.exports = (data) => {
if (!data.lastAppVersion) {
// don't apply if:
// - user chooses to block all fingerprinting (global setting)
// - user is not upgrading from 0.22.714 or earlier
if (data.fingerprintingProtectionAll || !data.lastAppVersion) {
return
}

Expand All @@ -18,7 +21,7 @@ module.exports = (data) => {
} catch (e) {}

if (migrationNeeded) {
const pattern = 'https://uphold.com'
const pattern = 'https?://uphold.com'
if (!data.siteSettings[pattern]) {
data.siteSettings[pattern] = {}
}
Expand Down
2 changes: 1 addition & 1 deletion js/data/siteSettingsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports.defaultSiteSettingsList = [
},
{
"name" : "fingerprintingProtection",
"pattern" : "https://uphold.com",
"pattern" : "https?://uphold.com",
"value" : "allowAllFingerprinting"
}
]
2 changes: 1 addition & 1 deletion test/unit/app/sessionStoreTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 +979,7 @@ describe('sessionStore unit tests', function () {
'https://www.youtube.com': {
autoplay: true
},
'https://uphold.com': {
'https?://uphold.com': {
fingerprintingProtection: 'allowAllFingerprinting'
}
}
Expand Down

0 comments on commit 321b208

Please sign in to comment.