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

Unified Diff: net/url_request/url_request.cc

Issue 714813003: Referrer Policy: Add new policies to URLRequest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tests. Created 6 years, 1 month 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 | « net/url_request/url_request.h ('k') | net/url_request/url_request_job.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request.cc
diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc
index a2ce07eaf13057c5608b9467e377ed77a9e98240..c61a14b3bac939e6dc727fdeb7d4be18cd7dc43c 100644
--- a/net/url_request/url_request.cc
+++ b/net/url_request/url_request.cc
@@ -650,12 +650,8 @@ void URLRequest::StartJob(URLRequestJob* job) {
response_info_.was_cached = false;
- // If the referrer is secure, but the requested URL is not, the referrer
- // policy should be something non-default. If you hit this, please file a
- // bug.
- if (referrer_policy_ ==
- CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE &&
- GURL(referrer_).SchemeIsSecure() && !url().SchemeIsSecure()) {
+ if (GURL(referrer_) != URLRequestJob::ComputeReferrerForRedirect(
+ referrer_policy_, referrer_, url())) {
if (!network_delegate_ ||
!network_delegate_->CancelURLRequestWithPolicyViolatingReferrerHeader(
*this, url(), GURL(referrer_))) {
« no previous file with comments | « net/url_request/url_request.h ('k') | net/url_request/url_request_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698