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

@@ -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.