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

Side by Side Diff: net/test/embedded_test_server/http_request.cc

Issue 2888043008: Revert of Allow use of Mojo/V8 ProxyResolvers with URLRequestContextBuilder. (Closed)
Patch Set: Created 3 years, 7 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 unified diff | Download patch
OLDNEW
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 #include <utility> 8 #include <utility>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 DCHECK_EQ(3u, header_line_tokens.size()); 103 DCHECK_EQ(3u, header_line_tokens.size());
104 // Method. 104 // Method.
105 http_request_->method_string = header_line_tokens[0]; 105 http_request_->method_string = header_line_tokens[0];
106 http_request_->method = 106 http_request_->method =
107 GetMethodType(base::ToLowerASCII(header_line_tokens[0])); 107 GetMethodType(base::ToLowerASCII(header_line_tokens[0]));
108 // Address. 108 // Address.
109 // Don't build an absolute URL as the parser does not know (should not 109 // Don't build an absolute URL as the parser does not know (should not
110 // know) anything about the server address. 110 // know) anything about the server address.
111 GURL url(header_line_tokens[1]); 111 GURL url(header_line_tokens[1]);
112 if (url.is_valid()) { 112 if (url.is_valid()) {
113 http_request_->relative_url = url.PathForRequest(); 113 http_request_->relative_url = url.path();
114 } else if (header_line_tokens[1][0] == '/') { 114 } else if (header_line_tokens[1][0] == '/') {
115 http_request_->relative_url = header_line_tokens[1]; 115 http_request_->relative_url = header_line_tokens[1];
116 } else { 116 } else {
117 http_request_->relative_url = "/" + header_line_tokens[1]; 117 http_request_->relative_url = "/" + header_line_tokens[1];
118 } 118 }
119 119
120 // Protocol. 120 // Protocol.
121 const std::string protocol = base::ToLowerASCII(header_line_tokens[2]); 121 const std::string protocol = base::ToLowerASCII(header_line_tokens[2]);
122 CHECK(protocol == "http/1.0" || protocol == "http/1.1") << 122 CHECK(protocol == "http/1.0" || protocol == "http/1.1") <<
123 "Protocol not supported: " << protocol; 123 "Protocol not supported: " << protocol;
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 return METHOD_CONNECT; 249 return METHOD_CONNECT;
250 } else if (token == "options") { 250 } else if (token == "options") {
251 return METHOD_OPTIONS; 251 return METHOD_OPTIONS;
252 } 252 }
253 LOG(WARNING) << "Method not implemented: " << token; 253 LOG(WARNING) << "Method not implemented: " << token;
254 return METHOD_GET; 254 return METHOD_GET;
255 } 255 }
256 256
257 } // namespace test_server 257 } // namespace test_server
258 } // namespace net 258 } // namespace net
OLDNEW
« no previous file with comments | « net/proxy/test_mojo_proxy_resolver_factory.cc ('k') | net/test/embedded_test_server/simple_connection_listener.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698