Commit c182a1a6 authored by Xinghui Lu's avatar Xinghui Lu Committed by Chromium LUCI CQ

Include URL fragment in real time URL requests.

Bug: 1152553, b/173469874
Change-Id: I5eb5ff522c67626fa7edfbefb383f9d25923b2d6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2558785Reviewed-by: default avatarVarun Khaneja <vakh@chromium.org>
Commit-Queue: Xinghui Lu <xinghuilu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#831940}
parent a0d1a964
...@@ -160,7 +160,10 @@ SBThreatType RealTimeUrlLookupServiceBase::GetSBThreatTypeForRTThreatType( ...@@ -160,7 +160,10 @@ SBThreatType RealTimeUrlLookupServiceBase::GetSBThreatTypeForRTThreatType(
// static // static
GURL RealTimeUrlLookupServiceBase::SanitizeURL(const GURL& url) { GURL RealTimeUrlLookupServiceBase::SanitizeURL(const GURL& url) {
return net::SimplifyUrlForRequest(url); GURL::Replacements replacements;
replacements.ClearUsername();
replacements.ClearPassword();
return url.ReplaceComponents(replacements);
} }
// static // static
......
...@@ -170,7 +170,7 @@ TEST_F(RealTimeUrlLookupServiceTest, TestFillRequestProto) { ...@@ -170,7 +170,7 @@ TEST_F(RealTimeUrlLookupServiceTest, TestFillRequestProto) {
{"http://example.com/", "http://example.com/"}, {"http://example.com/", "http://example.com/"},
{"http://user:pass@example.com/", "http://example.com/"}, {"http://user:pass@example.com/", "http://example.com/"},
{"http://%123:bar@example.com/", "http://example.com/"}, {"http://%123:bar@example.com/", "http://example.com/"},
{"http://example.com#123", "http://example.com/"}}; {"http://example.com/abc#123", "http://example.com/abc#123"}};
for (size_t i = 0; i < base::size(sanitize_url_cases); i++) { for (size_t i = 0; i < base::size(sanitize_url_cases); i++) {
GURL url(sanitize_url_cases[i].url); GURL url(sanitize_url_cases[i].url);
auto result = FillRequestProto(url); auto result = FillRequestProto(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