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

Side by Side 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: nits 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 748 matching lines...) Expand 10 before | Expand all | Expand 10 after
759 } 759 }
760 760
761 // Honor load flags that impact proxy caches. 761 // Honor load flags that impact proxy caches.
762 if (request_->load_flags & LOAD_BYPASS_CACHE) { 762 if (request_->load_flags & LOAD_BYPASS_CACHE) {
763 request_headers_.SetHeader(HttpRequestHeaders::kPragma, "no-cache"); 763 request_headers_.SetHeader(HttpRequestHeaders::kPragma, "no-cache");
764 request_headers_.SetHeader(HttpRequestHeaders::kCacheControl, "no-cache"); 764 request_headers_.SetHeader(HttpRequestHeaders::kCacheControl, "no-cache");
765 } else if (request_->load_flags & LOAD_VALIDATE_CACHE) { 765 } else if (request_->load_flags & LOAD_VALIDATE_CACHE) {
766 request_headers_.SetHeader(HttpRequestHeaders::kCacheControl, "max-age=0"); 766 request_headers_.SetHeader(HttpRequestHeaders::kCacheControl, "max-age=0");
767 } 767 }
768 768
769 if (ShouldApplyProxyAuth() && HaveAuth(HttpAuth::AUTH_PROXY)) 769 response_.request_has_auth = false;
770 if (ShouldApplyProxyAuth() && HaveAuth(HttpAuth::AUTH_PROXY)) {
770 auth_controllers_[HttpAuth::AUTH_PROXY]->AddAuthorizationHeader( 771 auth_controllers_[HttpAuth::AUTH_PROXY]->AddAuthorizationHeader(
771 &request_headers_); 772 &request_headers_);
772 if (ShouldApplyServerAuth() && HaveAuth(HttpAuth::AUTH_SERVER)) 773 response_.request_has_auth = true;
774 }
775 if (ShouldApplyServerAuth() && HaveAuth(HttpAuth::AUTH_SERVER)) {
773 auth_controllers_[HttpAuth::AUTH_SERVER]->AddAuthorizationHeader( 776 auth_controllers_[HttpAuth::AUTH_SERVER]->AddAuthorizationHeader(
774 &request_headers_); 777 &request_headers_);
778 response_.request_has_auth = true;
779 }
775 780
776 request_headers_.MergeFrom(request_->extra_headers); 781 request_headers_.MergeFrom(request_->extra_headers);
asanka 2013/04/09 17:38:51 I'm sorry I didn't see this earlier. Authorization
qinmin 2013/04/09 20:19:06 Done.
777 } 782 }
778 783
779 int HttpNetworkTransaction::DoInitRequestBody() { 784 int HttpNetworkTransaction::DoInitRequestBody() {
780 next_state_ = STATE_INIT_REQUEST_BODY_COMPLETE; 785 next_state_ = STATE_INIT_REQUEST_BODY_COMPLETE;
781 int rv = OK; 786 int rv = OK;
782 if (request_->upload_data_stream) 787 if (request_->upload_data_stream)
783 rv = request_->upload_data_stream->Init(io_callback_); 788 rv = request_->upload_data_stream->Init(io_callback_);
784 return rv; 789 return rv;
785 } 790 }
786 791
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after
1461 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, 1466 description = base::StringPrintf("Unknown state 0x%08X (%u)", state,
1462 state); 1467 state);
1463 break; 1468 break;
1464 } 1469 }
1465 return description; 1470 return description;
1466 } 1471 }
1467 1472
1468 #undef STATE_CASE 1473 #undef STATE_CASE
1469 1474
1470 } // namespace net 1475 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698