Commit 1f509735 authored by Francois Marier's avatar Francois Marier Committed by Commit Bot

Add URL query string parameter to phishing detection error page.

Bug: 1042466
Change-Id: I6097ebac532787baf383076fe9eeed9bff54aa4a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2003916Reviewed-by: default avatarNathan Parker <nparker@chromium.org>
Reviewed-by: default avatarNate Fischer <ntfschr@chromium.org>
Reviewed-by: default avatarVarun Khaneja <vakh@chromium.org>
Commit-Queue: Nate Fischer <ntfschr@chromium.org>
Auto-Submit: Francois Marier <francois@brave.com>
Cr-Commit-Position: refs/heads/master@{#737414}
parent 22bd6277
......@@ -1194,8 +1194,14 @@ public class SafeBrowsingTest {
@Feature({"AndroidWebView"})
public void testSafeBrowsingClickReportErrorLink() throws Throwable {
// Only phishing interstitials have the report-error-link
loadInterstitialAndClickLink(PHISHING_HTML_PATH, "report-error-link",
appendLocale("https://www.google.com/safebrowsing/report_error/"));
final String reportErrorUrl =
Uri.parse("https://safebrowsing.google.com/safebrowsing/report_error/")
.buildUpon()
.appendQueryParameter(
"url", mTestServer.getURL(PHISHING_HTML_PATH).toString())
.appendQueryParameter("hl", getSafeBrowsingLocaleOnUiThreadForTesting())
.toString();
loadInterstitialAndClickLink(PHISHING_HTML_PATH, "report-error-link", reportErrorUrl);
}
private String appendLocale(String url) throws Exception {
......
......@@ -27,7 +27,7 @@ const char kSbDiagnosticUrl[] =
// Constants for the V4 phishing string upgrades.
const char kReportPhishingErrorUrl[] =
"https://www.google.com/safebrowsing/report_error/";
"https://safebrowsing.google.com/safebrowsing/report_error/?url=%s";
void RecordExtendedReportingPrefChanged(bool report) {
UMA_HISTOGRAM_BOOLEAN(
......@@ -213,7 +213,10 @@ void SafeBrowsingLoudErrorUI::HandleCommand(
case CMD_REPORT_PHISHING_ERROR: {
controller()->metrics_helper()->RecordUserInteraction(
security_interstitials::MetricsHelper::REPORT_PHISHING_ERROR);
GURL phishing_error_url(kReportPhishingErrorUrl);
std::string phishing_error = base::StringPrintf(
kReportPhishingErrorUrl,
net::EscapeQueryParamValue(request_url().spec(), true).c_str());
GURL phishing_error_url(phishing_error);
phishing_error_url = google_util::AppendGoogleLocaleParam(
phishing_error_url, app_locale());
controller()->OpenURL(should_open_links_in_new_tab(), phishing_error_url);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment