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

Unified Diff: net/http/http_network_transaction.cc

Issue 13609002: fix a problem that android cannot download files with basic authentication (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressing comments Created 7 years, 8 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 | « chrome/browser/android/intercept_download_resource_throttle.cc ('k') | net/http/http_response_info.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {
« no previous file with comments | « chrome/browser/android/intercept_download_resource_throttle.cc ('k') | net/http/http_response_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698