Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Unified Diff: components/signin/core/browser/signin_header_helper.h

Issue 2258483002: X-Chrome-Connected is stripped when it should not be in headers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/signin/core/browser/signin_header_helper.h
diff --git a/components/signin/core/browser/signin_header_helper.h b/components/signin/core/browser/signin_header_helper.h
index 8d5d37c1fdcc523284ac89a205843ee7ce2fecc4..53d3797b798479f9cee8b1c04c50d82f4372d52e 100644
--- a/components/signin/core/browser/signin_header_helper.h
+++ b/components/signin/core/browser/signin_header_helper.h
@@ -30,6 +30,8 @@ enum ProfileMode {
PROFILE_MODE_ADD_ACCOUNT_DISABLED = 1 << 1
};
+extern const char kChromeConnectedHeader[];
+
// The ServiceType specified by GAIA in the response header accompanying the 204
// response. This indicates the action Chrome is supposed to lead the user to
// perform.
@@ -73,6 +75,10 @@ struct ManageAccountsParams {
bool SettingsAllowSigninCookies(
const content_settings::CookieSettings* cookie_settings);
+// Checks if the url has the required properties to have an
+// X-CHROME-CONNECTED header.
+bool IsUrlEligibleForXChromeConnectedHeader(const GURL& url);
+
// Returns the X-CHROME-CONNECTED cookie, or an empty string if it should not be
// added to the request to |url|.
std::string BuildMirrorRequestCookieIfPossible(
@@ -83,8 +89,8 @@ std::string BuildMirrorRequestCookieIfPossible(
// Adds X-Chrome-Connected header to all Gaia requests from a connected profile,
// with the exception of requests from gaia webview.
-// Returns true if the account management header was added to the request.
-bool AppendMirrorRequestHeaderIfPossible(
+// Removes the header in case it should not be transfered to a redirected url.
+bool AppendOrRemoveMirrorRequestHeaderIfPossible(
net::URLRequest* request,
const GURL& redirect_url,
const std::string& account_id,

Powered by Google App Engine
This is Rietveld 408576698