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 <set> | 7 #include <set> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
767 } | 767 } |
768 | 768 |
769 if (ShouldApplyProxyAuth() && HaveAuth(HttpAuth::AUTH_PROXY)) | 769 if (ShouldApplyProxyAuth() && HaveAuth(HttpAuth::AUTH_PROXY)) |
770 auth_controllers_[HttpAuth::AUTH_PROXY]->AddAuthorizationHeader( | 770 auth_controllers_[HttpAuth::AUTH_PROXY]->AddAuthorizationHeader( |
771 &request_headers_); | 771 &request_headers_); |
772 if (ShouldApplyServerAuth() && HaveAuth(HttpAuth::AUTH_SERVER)) | 772 if (ShouldApplyServerAuth() && HaveAuth(HttpAuth::AUTH_SERVER)) |
773 auth_controllers_[HttpAuth::AUTH_SERVER]->AddAuthorizationHeader( | 773 auth_controllers_[HttpAuth::AUTH_SERVER]->AddAuthorizationHeader( |
774 &request_headers_); | 774 &request_headers_); |
775 | 775 |
776 request_headers_.MergeFrom(request_->extra_headers); | 776 request_headers_.MergeFrom(request_->extra_headers); |
| 777 response_.did_use_http_auth = |
| 778 request_headers_.HasHeader(HttpRequestHeaders::kAuthorization) || |
| 779 request_headers_.HasHeader(HttpRequestHeaders::kProxyAuthorization); |
777 } | 780 } |
778 | 781 |
779 int HttpNetworkTransaction::DoInitRequestBody() { | 782 int HttpNetworkTransaction::DoInitRequestBody() { |
780 next_state_ = STATE_INIT_REQUEST_BODY_COMPLETE; | 783 next_state_ = STATE_INIT_REQUEST_BODY_COMPLETE; |
781 int rv = OK; | 784 int rv = OK; |
782 if (request_->upload_data_stream) | 785 if (request_->upload_data_stream) |
783 rv = request_->upload_data_stream->Init(io_callback_); | 786 rv = request_->upload_data_stream->Init(io_callback_); |
784 return rv; | 787 return rv; |
785 } | 788 } |
786 | 789 |
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1461 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, | 1464 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, |
1462 state); | 1465 state); |
1463 break; | 1466 break; |
1464 } | 1467 } |
1465 return description; | 1468 return description; |
1466 } | 1469 } |
1467 | 1470 |
1468 #undef STATE_CASE | 1471 #undef STATE_CASE |
1469 | 1472 |
1470 } // namespace net | 1473 } // namespace net |
OLD | NEW |