diff options
author | tzik <tzik@chromium.org> | 2015-12-21 00:56:11 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-12-21 08:57:13 +0000 |
commit | e4e4d491c18bbf4d5f3b37039b4896d84d3eca0e (patch) | |
tree | 7e3d7a69dabcd8e485623e87fa84444332552be4 /google_apis | |
parent | c52e003a0fb6bf8ae9d79afb52ad20d84f439b99 (diff) | |
download | chromium_src-e4e4d491c18bbf4d5f3b37039b4896d84d3eca0e.zip chromium_src-e4e4d491c18bbf4d5f3b37039b4896d84d3eca0e.tar.gz chromium_src-e4e4d491c18bbf4d5f3b37039b4896d84d3eca0e.tar.bz2 |
Handle HTTP headers case-insensitively on the test server
The HTTP spec says the name of HTTP headers should be case-insensitive,
while our embedded test server doesn't. That blocks a on-going Blink
side change for the case normalization of HTTP header names.
BUG=556969
Review URL: https://codereview.chromium.org/1474603002
Cr-Commit-Position: refs/heads/master@{#366348}
Diffstat (limited to 'google_apis')
-rw-r--r-- | google_apis/drive/drive_api_requests_unittest.cc | 6 | ||||
-rw-r--r-- | google_apis/gaia/fake_gaia.cc | 3 |
2 files changed, 3 insertions, 6 deletions
diff --git a/google_apis/drive/drive_api_requests_unittest.cc b/google_apis/drive/drive_api_requests_unittest.cc index 1df9680..4ac64e5 100644 --- a/google_apis/drive/drive_api_requests_unittest.cc +++ b/google_apis/drive/drive_api_requests_unittest.cc @@ -328,8 +328,7 @@ class DriveApiRequestsTest : public testing::Test { // Check if the X-Upload-Content-Length is present. If yes, store the // length of the file. - std::map<std::string, std::string>::const_iterator found = - request.headers.find("X-Upload-Content-Length"); + auto found = request.headers.find("X-Upload-Content-Length"); if (found == request.headers.end() || !base::StringToInt64(found->second, &content_length_)) { return scoped_ptr<net::test_server::HttpResponse>(); @@ -354,8 +353,7 @@ class DriveApiRequestsTest : public testing::Test { http_request_ = request; if (!request.content.empty()) { - std::map<std::string, std::string>::const_iterator iter = - request.headers.find("Content-Range"); + auto iter = request.headers.find("Content-Range"); if (iter == request.headers.end()) { // The range must be set. return scoped_ptr<net::test_server::HttpResponse>(); diff --git a/google_apis/gaia/fake_gaia.cc b/google_apis/gaia/fake_gaia.cc index a4a7d1d..9c7e483 100644 --- a/google_apis/gaia/fake_gaia.cc +++ b/google_apis/gaia/fake_gaia.cc @@ -97,8 +97,7 @@ CookieMap GetRequestCookies(const HttpRequest& request) { bool GetAccessToken(const HttpRequest& request, const char* auth_token_prefix, std::string* access_token) { - std::map<std::string, std::string>::const_iterator auth_header_entry = - request.headers.find("Authorization"); + auto auth_header_entry = request.headers.find("Authorization"); if (auth_header_entry != request.headers.end()) { if (base::StartsWith(auth_header_entry->second, auth_token_prefix, base::CompareCase::SENSITIVE)) { |