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

Check cookie exception before purging cookie request #6853

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Check cookie exception before purging cookie request

Add www.zillow.com to siteHack

fix #6811

Auditors: @bbondy, @bridiver

Test Plan:
1. Go to www.zillow.com
2. Login with facebook
  • Loading branch information
darkdh committed Jan 25, 2017
commit 0e54c0d2bb71a9157617eb4ae35df389d31f9c89
@@ -32,6 +32,8 @@ const path = require('path')
const getOrigin = require('../js/state/siteUtil').getOrigin
const {adBlockResourceName} = require('./adBlock')
const {updateElectronDownloadItem} = require('./browser/electronDownloadItem')
const {makeImmutable} = require('../app/common/state/immutableUtil')
const cookieExceptions = makeImmutable(require('../js/data/siteHacks').cookieExceptions)

let appStore = null

@@ -256,9 +258,12 @@ function registerForBeforeSendHeaders (session, partition) {
if (module.exports.isResourceEnabled(appConfig.resourceNames.COOKIEBLOCK, firstPartyUrl, isPrivate)) {
if (module.exports.isThirdPartyHost(urlParse(firstPartyUrl || '').hostname,
parsedUrl.hostname)) {
// For matching cookie exceptions
const cookie = makeImmutable([firstPartyUrl.replace(/\/$/g, ''), parsedUrl.protocol + '//' + parsedUrl.hostname])
// Clear cookie and referer on third-party requests
if (requestHeaders['Cookie'] &&
getOrigin(firstPartyUrl) !== pdfjsOrigin) {
getOrigin(firstPartyUrl) !== pdfjsOrigin &&
!cookieExceptions.includes(cookie)) {
requestHeaders['Cookie'] = undefined
}
if (requestHeaders['Referer'] &&
@@ -26,7 +26,9 @@ const emptyDataURI = {
*/
module.exports.cookieExceptions = [
['https://inbox.google.com', 'https://hangouts.google.com'],
['https://mail.google.com', 'https://hangouts.google.com']
['https://mail.google.com', 'https://hangouts.google.com'],
['http://www.zillow.com', 'https://www.facebook.com'],
['http://www.zillow.com', 'https://accounts.google.com']
]

/**
@@ -35,7 +37,9 @@ module.exports.cookieExceptions = [
*/
module.exports.localStorageExceptions = [
['https://inbox.google.com', 'https://hangouts.google.com'],
['https://mail.google.com', 'https://hangouts.google.com']
['https://mail.google.com', 'https://hangouts.google.com'],
['http://www.zillow.com', 'https://www.facebook.com'],
['http://www.zillow.com', 'https://accounts.google.com']
]

module.exports.siteHacks = {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.