| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/test/embedded_test_server/http_request.h" | 5 #include "net/test/embedded_test_server/http_request.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| 11 #include "base/strings/string_number_conversions.h" | 11 #include "base/strings/string_number_conversions.h" |
| 12 #include "base/strings/string_split.h" | 12 #include "base/strings/string_split.h" |
| 13 | 13 |
| 14 namespace net { | 14 namespace net { |
| 15 namespace test_server { | 15 namespace test_server { |
| 16 | 16 |
| 17 namespace { | 17 namespace { |
| 18 | 18 |
| 19 size_t kRequestSizeLimit = 64 * 1024 * 1024; // 64 mb. | 19 size_t kRequestSizeLimit = 64 * 1024 * 1024; // 64 mb. |
| 20 | 20 |
| 21 // Helper function used to trim tokens in http request headers. | 21 // Helper function used to trim tokens in http request headers. |
| 22 std::string Trim(const std::string& value) { | 22 std::string Trim(const std::string& value) { |
| 23 std::string result; | 23 std::string result; |
| 24 TrimString(value, " \t", &result); | 24 base::TrimString(value, " \t", &result); |
| 25 return result; | 25 return result; |
| 26 } | 26 } |
| 27 | 27 |
| 28 } // namespace | 28 } // namespace |
| 29 | 29 |
| 30 HttpRequest::HttpRequest() : method(METHOD_UNKNOWN), | 30 HttpRequest::HttpRequest() : method(METHOD_UNKNOWN), |
| 31 has_content(false) { | 31 has_content(false) { |
| 32 } | 32 } |
| 33 | 33 |
| 34 HttpRequest::~HttpRequest() { | 34 HttpRequest::~HttpRequest() { |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 return METHOD_DELETE; | 193 return METHOD_DELETE; |
| 194 } else if (token == "patch") { | 194 } else if (token == "patch") { |
| 195 return METHOD_PATCH; | 195 return METHOD_PATCH; |
| 196 } | 196 } |
| 197 NOTREACHED() << "Method not implemented: " << token; | 197 NOTREACHED() << "Method not implemented: " << token; |
| 198 return METHOD_UNKNOWN; | 198 return METHOD_UNKNOWN; |
| 199 } | 199 } |
| 200 | 200 |
| 201 } // namespace test_server | 201 } // namespace test_server |
| 202 } // namespace net | 202 } // namespace net |
| OLD | NEW |