Index: net/http/http_network_transaction.cc |
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc |
index 467eb940a65d7a6687b7085b3e9257f615036ab5..e2566f81e865774c57b2f0ccb17e11a9ebfdde2b 100644 |
--- a/net/http/http_network_transaction.cc |
+++ b/net/http/http_network_transaction.cc |
@@ -766,14 +766,23 @@ void HttpNetworkTransaction::BuildRequestHeaders(bool using_proxy) { |
request_headers_.SetHeader(HttpRequestHeaders::kCacheControl, "max-age=0"); |
} |
- if (ShouldApplyProxyAuth() && HaveAuth(HttpAuth::AUTH_PROXY)) |
+ bool has_auth = false; |
+ if (ShouldApplyProxyAuth() && HaveAuth(HttpAuth::AUTH_PROXY)) { |
auth_controllers_[HttpAuth::AUTH_PROXY]->AddAuthorizationHeader( |
&request_headers_); |
- if (ShouldApplyServerAuth() && HaveAuth(HttpAuth::AUTH_SERVER)) |
+ has_auth = true; |
asanka
2013/04/09 21:55:13
These are redundant with the check below. If the A
qinmin
2013/04/09 22:10:06
ah... ok, done
On 2013/04/09 21:55:13, asanka wro
|
+ } |
+ if (ShouldApplyServerAuth() && HaveAuth(HttpAuth::AUTH_SERVER)) { |
auth_controllers_[HttpAuth::AUTH_SERVER]->AddAuthorizationHeader( |
&request_headers_); |
+ has_auth = true; |
+ } |
request_headers_.MergeFrom(request_->extra_headers); |
+ has_auth = has_auth && ( |
+ request_headers_.HasHeader(HttpRequestHeaders::kAuthorization) || |
+ request_headers_.HasHeader(HttpRequestHeaders::kProxyAuthorization)); |
+ response_.did_use_http_auth = has_auth; |
} |
int HttpNetworkTransaction::DoInitRequestBody() { |