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

Unified Diff: content/browser/loader/resource_dispatcher_host_impl.cc

Issue 2333513002: Fix SSL redirects with PlzNavigate. (Closed)
Patch Set: slightly different fix Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/loader/resource_dispatcher_host_impl.cc
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc
index 60850fda2948793e1ef211bab495c073daaefdae..46b6402dd33ba7a137d79e758fddb3beace4126a 100644
--- a/content/browser/loader/resource_dispatcher_host_impl.cc
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -1363,9 +1363,17 @@ void ResourceDispatcherHostImpl::ContinuePendingBeginRequest(
new_request->set_first_party_url_policy(
net::URLRequest::UPDATE_FIRST_PARTY_URL_ON_REDIRECT);
}
-
- const Referrer referrer(request_data.referrer, request_data.referrer_policy);
- SetReferrerForRequest(new_request.get(), referrer);
+
+ // For PlzNavigate, this request has already been made and the referrer was
+ // checked previously. So don't set the referrer for this stream request, or
+ // else it will fail for SSL redirects since net/ will think the blob:https
+ // for the stream is not a secure scheme (specifically, in the call to
+ // ComputeReferrerForRedirect).
+ if (!is_navigation_stream_request) {
+ const Referrer referrer(
+ request_data.referrer, request_data.referrer_policy);
+ SetReferrerForRequest(new_request.get(), referrer);
+ }
new_request->SetExtraRequestHeaders(headers);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698