-
Notifications
You must be signed in to change notification settings - Fork 0
/
0001-safe_browsing-support-trk-prefix.patch
33 lines (30 loc) · 1.54 KB
/
0001-safe_browsing-support-trk-prefix.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
From 78133aed992d2a9489a3295bb198de3059aed837 Mon Sep 17 00:00:00 2001
From: Joachim Bauch <[email protected]>
Date: Mon, 6 Jul 2015 18:18:03 +0200
Subject: [PATCH] safe_browsing: support trk: prefix
---
chrome/browser/safe_browsing/protocol_manager.cc | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/chrome/browser/safe_browsing/protocol_manager.cc b/chrome/browser/safe_browsing/protocol_manager.cc
index f4cdc8eacd3d..9ef0471453ea 100644
--- a/chrome/browser/safe_browsing/protocol_manager.cc
+++ b/chrome/browser/safe_browsing/protocol_manager.cc
@@ -866,11 +866,13 @@ GURL SafeBrowsingProtocolManager::GetHashUrl(
GURL SafeBrowsingProtocolManager::NextChunkUrl(const std::string& url) const {
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
std::string next_url;
- if (!base::StartsWith(url, "http://", base::CompareCase::INSENSITIVE_ASCII) &&
- !base::StartsWith(url, "https://",
+ const std::string notrk_url(GURL(url).strip_trk().spec());
+ const std::string notrk_url_prefix_(GURL(url_prefix_).strip_trk().spec());
+ if (!base::StartsWith(notrk_url, "http://", base::CompareCase::INSENSITIVE_ASCII) &&
+ !base::StartsWith(notrk_url, "https://",
base::CompareCase::INSENSITIVE_ASCII)) {
// Use https if we updated via https, otherwise http (useful for testing).
- if (base::StartsWith(url_prefix_, "https://",
+ if (base::StartsWith(notrk_url_prefix_, "https://",
base::CompareCase::INSENSITIVE_ASCII))
next_url.append("https://");
else
--
2.14.3