Chromium Code Reviews| Index: google_apis/gaia/gaia_auth_fetcher.cc |
| diff --git a/google_apis/gaia/gaia_auth_fetcher.cc b/google_apis/gaia/gaia_auth_fetcher.cc |
| index ca6054a33076852a7069e7ec4de4df8cb3d404ac..bee9a1e951460f9f9a4e410538671f72eddbf824 100644 |
| --- a/google_apis/gaia/gaia_auth_fetcher.cc |
| +++ b/google_apis/gaia/gaia_auth_fetcher.cc |
| @@ -72,6 +72,19 @@ bool ExtractOAuth2TokenPairResponse(const std::string& data, |
| return true; |
| } |
| +void GetCookiesFromResponse(net::HttpResponseHeaders* headers, |
|
Roger Tawa OOO till Jul 10th
2016/06/14 15:57:40
This should be a const ptr.
martijnc
2016/06/14 22:18:08
Done.
|
| + net::ResponseCookies* cookies) { |
| + if (!headers) |
| + return; |
| + |
| + std::string value; |
| + size_t iter = 0; |
| + while (headers->EnumerateHeader(&iter, "Set-Cookie", &value)) { |
| + if (!value.empty()) |
| + cookies->push_back(value); |
| + } |
| +} |
| + |
| const char kListIdpServiceRequested[] = "list_idp"; |
| const char kGetTokenResponseRequested[] = "get_token"; |
| @@ -944,8 +957,9 @@ void GaiaAuthFetcher::OnURLFetchComplete(const net::URLFetcher* source) { |
| DVLOG(2) << "data: " << data << "\n"; |
| #endif |
| - DispatchFetchedRequest(url, data, source->GetCookies(), status, |
| - response_code); |
| + net::ResponseCookies cookies; |
| + GetCookiesFromResponse(source->GetResponseHeaders(), &cookies); |
| + DispatchFetchedRequest(url, data, cookies, status, response_code); |
| } |
| void GaiaAuthFetcher::DispatchFetchedRequest( |