From fcdc73f35abd477bb4c0953c8164f77f7877fdb4 Mon Sep 17 00:00:00 2001 From: "rogerta@chromium.org" Date: Mon, 16 Dec 2013 23:11:09 +0000 Subject: [PATCH] GaiaOAuthClient::Core::GetUserInfo() does not need to send or receive cookies. The function should set the load flags to ignore cookies. BUG=327120 Review URL: https://codereview.chromium.org/98403011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@241058 0039d316-1c4b-4281-b951-d872f2087c98 --- google_apis/gaia/gaia_oauth_client.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/google_apis/gaia/gaia_oauth_client.cc b/google_apis/gaia/gaia_oauth_client.cc index dc83dbecdf41..8c6e1807369d 100644 --- a/google_apis/gaia/gaia_oauth_client.cc +++ b/google_apis/gaia/gaia_oauth_client.cc @@ -11,6 +11,7 @@ #include "base/values.h" #include "google_apis/gaia/gaia_urls.h" #include "net/base/escape.h" +#include "net/base/load_flags.h" #include "net/http/http_status_code.h" #include "net/url_request/url_fetcher.h" #include "net/url_request/url_fetcher_delegate.h" @@ -167,6 +168,9 @@ void GaiaOAuthClient::Core::GetUserInfo(const std::string& oauth_access_token, request_->SetRequestContext(request_context_getter_.get()); request_->AddExtraRequestHeader("Authorization: OAuth " + oauth_access_token); request_->SetMaxRetriesOn5xx(max_retries); + request_->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES | + net::LOAD_DO_NOT_SAVE_COOKIES); + // Fetchers are sometimes cancelled because a network change was detected, // especially at startup and after sign-in on ChromeOS. Retrying once should // be enough in those cases; let the fetcher retry up to 3 times just in case. @@ -202,6 +206,8 @@ void GaiaOAuthClient::Core::MakeGaiaRequest( request_->SetRequestContext(request_context_getter_.get()); request_->SetUploadData("application/x-www-form-urlencoded", post_body); request_->SetMaxRetriesOn5xx(max_retries); + request_->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES | + net::LOAD_DO_NOT_SAVE_COOKIES); // See comment on SetAutomaticallyRetryOnNetworkChanges() above. request_->SetAutomaticallyRetryOnNetworkChanges(3); request_->Start(); -- 2.11.4.GIT