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

Unified Diff: net/test/embedded_test_server/http_request.cc

Issue 1421903008: Revert of SSL in EmbeddedTestServer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/test/embedded_test_server/http_request.h ('k') | net/test/embedded_test_server/http_response.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/test/embedded_test_server/http_request.cc
diff --git a/net/test/embedded_test_server/http_request.cc b/net/test/embedded_test_server/http_request.cc
index 23a4f9249aa21ed34b7792bcb6dc9a483627163a..9e0c80f96fa092aa2ce05dee5975ba9c68734625 100644
--- a/net/test/embedded_test_server/http_request.cc
+++ b/net/test/embedded_test_server/http_request.cc
@@ -11,7 +11,6 @@
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "net/http/http_chunked_decoder.h"
-#include "url/gurl.h"
namespace net {
namespace test_server {
@@ -34,11 +33,6 @@
}
HttpRequest::~HttpRequest() {
-}
-
-GURL HttpRequest::GetURL() const {
- // TODO(svaldez): Use real URL from the EmbeddedTestServer.
- return GURL("http://localhost" + relative_url);
}
HttpRequestParser::HttpRequestParser()
@@ -104,15 +98,7 @@
// Address.
// Don't build an absolute URL as the parser does not know (should not
// know) anything about the server address.
- GURL url(header_line_tokens[1]);
- if (url.is_valid()) {
- http_request_->relative_url = url.path();
- } else if (header_line_tokens[1][0] == '/') {
- http_request_->relative_url = header_line_tokens[1];
- } else {
- http_request_->relative_url = "/" + header_line_tokens[1];
- }
-
+ http_request_->relative_url = header_line_tokens[1];
// Protocol.
const std::string protocol = base::ToLowerASCII(header_line_tokens[2]);
CHECK(protocol == "http/1.0" || protocol == "http/1.1") <<
@@ -153,10 +139,7 @@
const bool success = base::StringToSizeT(
http_request_->headers["Content-Length"],
&declared_content_length_);
- if (!success) {
- declared_content_length_ = 0;
- LOG(WARNING) << "Malformed Content-Length header's value.";
- }
+ DCHECK(success) << "Malformed Content-Length header's value.";
} else if (http_request_->headers.count("Transfer-Encoding") > 0) {
if (http_request_->headers["Transfer-Encoding"] == "chunked") {
http_request_->has_content = true;
@@ -241,11 +224,9 @@
return METHOD_DELETE;
} else if (token == "patch") {
return METHOD_PATCH;
- } else if (token == "connect") {
- return METHOD_CONNECT;
- }
- LOG(WARNING) << "Method not implemented: " << token;
- return METHOD_GET;
+ }
+ NOTREACHED() << "Method not implemented: " << token;
+ return METHOD_UNKNOWN;
}
} // namespace test_server
« no previous file with comments | « net/test/embedded_test_server/http_request.h ('k') | net/test/embedded_test_server/http_response.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698