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

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

Issue 12569007: Remove URL fragment from referrer HTTP header when opening link using "Open Link in New Tab" option. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address code review comments Created 7 years, 9 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/url_request/url_request_http_job.h" 5 #include "net/url_request/url_request_http_job.h"
6 6
7 #include "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after
862 void URLRequestHttpJob::SetExtraRequestHeaders( 862 void URLRequestHttpJob::SetExtraRequestHeaders(
863 const HttpRequestHeaders& headers) { 863 const HttpRequestHeaders& headers) {
864 DCHECK(!transaction_.get()) << "cannot change once started"; 864 DCHECK(!transaction_.get()) << "cannot change once started";
865 request_info_.extra_headers.CopyFrom(headers); 865 request_info_.extra_headers.CopyFrom(headers);
866 } 866 }
867 867
868 void URLRequestHttpJob::Start() { 868 void URLRequestHttpJob::Start() {
869 DCHECK(!transaction_.get()); 869 DCHECK(!transaction_.get());
870 870
871 // Ensure that we do not send username and password fields in the referrer. 871 // Ensure that we do not send username and password fields in the referrer.
872 GURL referrer(request_->GetSanitizedReferrer()); 872 GURL referrer(request_->referrer());
873 873
874 request_info_.url = request_->url(); 874 request_info_.url = request_->url();
875 request_info_.method = request_->method(); 875 request_info_.method = request_->method();
876 request_info_.load_flags = request_->load_flags(); 876 request_info_.load_flags = request_->load_flags();
877 request_info_.priority = request_->priority(); 877 request_info_.priority = request_->priority();
878 request_info_.request_id = request_->identifier(); 878 request_info_.request_id = request_->identifier();
879 879
880 // Strip Referer from request_info_.extra_headers to prevent, e.g., plugins 880 // Strip Referer from request_info_.extra_headers to prevent, e.g., plugins
881 // from overriding headers that are controlled using other means. Otherwise a 881 // from overriding headers that are controlled using other means. Otherwise a
882 // plugin could set a referrer although sending the referrer is inhibited. 882 // plugin could set a referrer although sending the referrer is inhibited.
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
1576 1576
1577 void URLRequestHttpJob::NotifyURLRequestDestroyed() { 1577 void URLRequestHttpJob::NotifyURLRequestDestroyed() {
1578 awaiting_callback_ = false; 1578 awaiting_callback_ = false;
1579 } 1579 }
1580 1580
1581 void URLRequestHttpJob::OnDetachRequest() { 1581 void URLRequestHttpJob::OnDetachRequest() {
1582 http_transaction_delegate_->OnDetachRequest(); 1582 http_transaction_delegate_->OnDetachRequest();
1583 } 1583 }
1584 1584
1585 } // namespace net 1585 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698