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

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: I hate compilers. 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
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..66817cf1868362d29957183be8712f77ac7c99e2 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(*this, url())) {
mmenke 2014/11/20 16:23:45 optional nit: To make it clearer the second line
Mike West 2014/11/21 09:29:29 Done.
if (!network_delegate_ ||
!network_delegate_->CancelURLRequestWithPolicyViolatingReferrerHeader(
*this, url(), GURL(referrer_))) {

Powered by Google App Engine
This is Rietveld 408576698