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

Unified Diff: content/browser/download/url_downloader.cc

Issue 2927123002: Ensure that the referrer for HTTPS to HTTP downloads is dropped. (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/download/download_browsertest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/url_downloader.cc
diff --git a/content/browser/download/url_downloader.cc b/content/browser/download/url_downloader.cc
index c20669db6911a00e11a3b94f1c1b06ee1bd49508..c35c1e7c842a41050c09c7ccab8f770668ab42a6 100644
--- a/content/browser/download/url_downloader.cc
+++ b/content/browser/download/url_downloader.cc
@@ -67,7 +67,9 @@ std::unique_ptr<UrlDownloader> UrlDownloader::BeginDownload(
std::unique_ptr<net::URLRequest> request,
const Referrer& referrer,
bool is_parallel_request) {
- Referrer::SetReferrerForRequest(request.get(), referrer);
+ Referrer sanitized_referrer =
+ Referrer::SanitizeForRequest(request->url(), referrer);
asanka 2017/06/08 16:44:30 Whoa. This step is pretty easy to miss.
David Trainor- moved to gerrit 2017/06/08 17:16:38 Should we have a bool sanitize in SetReferrerForRe
svaldez 2017/06/08 18:26:07 Hmm, it looks like most other callers sanitize it
+ Referrer::SetReferrerForRequest(request.get(), sanitized_referrer);
if (request->url().SchemeIs(url::kBlobScheme))
return nullptr;
« no previous file with comments | « content/browser/download/download_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698