Skip to content

Commit

Permalink
add cookie exceptions so that *.google.com and *.googleapis.com domai…
Browse files Browse the repository at this point in the history
…ns can set and send cookies for each other, fixes brave/brave-browser#1122
  • Loading branch information
pes10k authored and bridiver committed Apr 28, 2020
1 parent 50ff33b commit 8e96e22
Showing 1 changed file with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,27 @@ void BravePrefProvider::UpdateCookieRules(ContentSettingsType content_type,
rules.push_back(CloneRule(wp_com_rule));
brave_cookie_rules_[incognito].push_back(CloneRule(wp_com_rule));

// Add ability for google properties to send cookies to each other,
// especially needed for google drive playback.
//
// Partial fix for https://github.com/brave/brave-browser/issues/1122
const auto googleapis_com_pattern = ContentSettingsPattern::FromString(
"https://[*.]googleapis.com/*");
const auto google_com_pattern = ContentSettingsPattern::FromString(
"https://[*.]google.com/*");
const std::vector<ContentSettingsPattern> patterns = {
googleapis_com_pattern, google_com_pattern};
for (const auto &outer : patterns) {
for (const auto &inner : patterns) {
const auto a_rule = Rule(
outer,
inner,
ContentSettingToValue(CONTENT_SETTING_ALLOW)->Clone());
rules.push_back(CloneRule(a_rule));
brave_cookie_rules_[incognito].push_back(CloneRule(a_rule));
}
}

// add chromium cookies
auto chromium_cookies_iterator = PrefProvider::GetRuleIterator(
ContentSettingsType::COOKIES,
Expand Down

0 comments on commit 8e96e22

Please sign in to comment.