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

Side by Side Diff: net/url_request/url_request_ftp_job.cc

Issue 2067933002: Use correct origin when prompting for proxy authentication. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix content_shell build. Created 4 years, 6 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
« no previous file with comments | « net/http/http_network_transaction_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/url_request/url_request_ftp_job.h" 5 #include "net/url_request/url_request_ftp_job.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 scoped_refptr<AuthChallengeInfo>* result) { 284 scoped_refptr<AuthChallengeInfo>* result) {
285 DCHECK(NeedsAuth()); 285 DCHECK(NeedsAuth());
286 286
287 if (http_response_info_) { 287 if (http_response_info_) {
288 *result = http_response_info_->auth_challenge; 288 *result = http_response_info_->auth_challenge;
289 return; 289 return;
290 } 290 }
291 291
292 scoped_refptr<AuthChallengeInfo> auth_info(new AuthChallengeInfo); 292 scoped_refptr<AuthChallengeInfo> auth_info(new AuthChallengeInfo);
293 auth_info->is_proxy = false; 293 auth_info->is_proxy = false;
294 auth_info->challenger = HostPortPair::FromURL(request_->url()); 294 auth_info->challenger = url::Origin(request_->url());
295 // scheme and realm are kept empty. 295 // scheme and realm are kept empty.
296 DCHECK(auth_info->scheme.empty()); 296 DCHECK(auth_info->scheme.empty());
297 DCHECK(auth_info->realm.empty()); 297 DCHECK(auth_info->realm.empty());
298 result->swap(auth_info); 298 result->swap(auth_info);
299 } 299 }
300 300
301 void URLRequestFtpJob::SetAuth(const AuthCredentials& credentials) { 301 void URLRequestFtpJob::SetAuth(const AuthCredentials& credentials) {
302 DCHECK(ftp_transaction_ || http_transaction_); 302 DCHECK(ftp_transaction_ || http_transaction_);
303 DCHECK(NeedsAuth()); 303 DCHECK(NeedsAuth());
304 304
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 if (cached_auth) { 372 if (cached_auth) {
373 // Retry using cached auth data. 373 // Retry using cached auth data.
374 SetAuth(cached_auth->credentials); 374 SetAuth(cached_auth->credentials);
375 } else { 375 } else {
376 // Prompt for a username/password. 376 // Prompt for a username/password.
377 NotifyHeadersComplete(); 377 NotifyHeadersComplete();
378 } 378 }
379 } 379 }
380 380
381 } // namespace net 381 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_network_transaction_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698