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

Unified Diff: net/http/http_stream_parser.cc

Issue 16776005: net: use IsSecureScheme rather than matching "https". (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ERR_HEADERS_TRUNCATED => ERR_RESPONSE_HEADERS_TRUNCATED Created 7 years, 6 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/http/http_proxy_client_socket_pool_spdy3_unittest.cc ('k') | net/http/http_stream_parser_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_stream_parser.cc
diff --git a/net/http/http_stream_parser.cc b/net/http/http_stream_parser.cc
index 17b5c6e3f9e08a86e3a5602c23d68e257fe0b79e..d48627b10d215ab72da472d7c33f4d3491880d7e 100644
--- a/net/http/http_stream_parser.cc
+++ b/net/http/http_stream_parser.cc
@@ -544,12 +544,12 @@ int HttpStreamParser::DoReadHeadersComplete(int result) {
// rather than empty HTTP/0.9 response.
io_state_ = STATE_DONE;
return ERR_EMPTY_RESPONSE;
- } else if (request_->url.SchemeIs("https")) {
+ } else if (request_->url.SchemeIsSecure()) {
// The connection was closed in the middle of the headers. For HTTPS we
// don't parse partial headers. Return a different error code so that we
// know that we shouldn't attempt to retry the request.
io_state_ = STATE_DONE;
- return ERR_HEADERS_TRUNCATED;
+ return ERR_RESPONSE_HEADERS_TRUNCATED;
}
// Parse things as well as we can and let the caller decide what to do.
int end_offset;
@@ -897,7 +897,7 @@ bool HttpStreamParser::IsConnectionReusable() const {
}
void HttpStreamParser::GetSSLInfo(SSLInfo* ssl_info) {
- if (request_->url.SchemeIs("https") && connection_->socket()) {
+ if (request_->url.SchemeIsSecure() && connection_->socket()) {
SSLClientSocket* ssl_socket =
static_cast<SSLClientSocket*>(connection_->socket());
ssl_socket->GetSSLInfo(ssl_info);
@@ -906,7 +906,7 @@ void HttpStreamParser::GetSSLInfo(SSLInfo* ssl_info) {
void HttpStreamParser::GetSSLCertRequestInfo(
SSLCertRequestInfo* cert_request_info) {
- if (request_->url.SchemeIs("https") && connection_->socket()) {
+ if (request_->url.SchemeIsSecure() && connection_->socket()) {
SSLClientSocket* ssl_socket =
static_cast<SSLClientSocket*>(connection_->socket());
ssl_socket->GetSSLCertRequestInfo(cert_request_info);
« no previous file with comments | « net/http/http_proxy_client_socket_pool_spdy3_unittest.cc ('k') | net/http/http_stream_parser_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698