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/http/http_network_transaction.h" | 5 #include "net/http/http_network_transaction.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <set> | 8 #include <set> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 1220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1231 // We treat any other 1xx in this same way (although in practice getting | 1231 // We treat any other 1xx in this same way (although in practice getting |
1232 // a 1xx that isn't a 100 is rare). | 1232 // a 1xx that isn't a 100 is rare). |
1233 // Unless this is a WebSocket request, in which case we pass it on up. | 1233 // Unless this is a WebSocket request, in which case we pass it on up. |
1234 if (response_.headers->response_code() / 100 == 1 && | 1234 if (response_.headers->response_code() / 100 == 1 && |
1235 !ForWebSocketHandshake()) { | 1235 !ForWebSocketHandshake()) { |
1236 response_.headers = new HttpResponseHeaders(std::string()); | 1236 response_.headers = new HttpResponseHeaders(std::string()); |
1237 next_state_ = STATE_READ_HEADERS; | 1237 next_state_ = STATE_READ_HEADERS; |
1238 return OK; | 1238 return OK; |
1239 } | 1239 } |
1240 | 1240 |
1241 session_->http_stream_factory()->ProcessAlternativeServices( | 1241 if (session_->params().enable_alternative_service_for_insecure_origins || |
1242 session_, response_.headers.get(), url::SchemeHostPort(request_->url)); | 1242 IsSecureRequest()) { |
| 1243 session_->http_stream_factory()->ProcessAlternativeServices( |
| 1244 session_, response_.headers.get(), url::SchemeHostPort(request_->url)); |
| 1245 } |
1243 | 1246 |
1244 if (IsSecureRequest()) | 1247 if (IsSecureRequest()) |
1245 stream_->GetSSLInfo(&response_.ssl_info); | 1248 stream_->GetSSLInfo(&response_.ssl_info); |
1246 | 1249 |
1247 int rv = HandleAuthChallenge(); | 1250 int rv = HandleAuthChallenge(); |
1248 if (rv != OK) | 1251 if (rv != OK) |
1249 return rv; | 1252 return rv; |
1250 | 1253 |
1251 headers_valid_ = true; | 1254 headers_valid_ = true; |
1252 return OK; | 1255 return OK; |
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1795 DCHECK(stream_request_); | 1798 DCHECK(stream_request_); |
1796 | 1799 |
1797 // Since the transaction can restart with auth credentials, it may create a | 1800 // Since the transaction can restart with auth credentials, it may create a |
1798 // stream more than once. Accumulate all of the connection attempts across | 1801 // stream more than once. Accumulate all of the connection attempts across |
1799 // those streams by appending them to the vector: | 1802 // those streams by appending them to the vector: |
1800 for (const auto& attempt : stream_request_->connection_attempts()) | 1803 for (const auto& attempt : stream_request_->connection_attempts()) |
1801 connection_attempts_.push_back(attempt); | 1804 connection_attempts_.push_back(attempt); |
1802 } | 1805 } |
1803 | 1806 |
1804 } // namespace net | 1807 } // namespace net |
OLD | NEW |