author | Jan-Erik Rediger <jrediger@mozilla.com> |
Fri, 13 Dec 2019 16:33:04 +0000 | |
changeset 506922 | 07ec23676b974d6be94b0e83a9fa342e82ac364b |
parent 506921 | 8590ed6875bed721318fb8223e00933cf822b3ee |
child 506923 | 77a6b06925100509d1f40190bd1048f6b6f44527 |
push id | 36915 |
push user | rgurzau@mozilla.com |
push date | Fri, 13 Dec 2019 21:43:22 +0000 |
treeherder | mozilla-central@f09f24f2b545 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | chutten |
bugs | 1603746 |
milestone | 73.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
toolkit/components/telemetry/pingsender/pingsender_unix_common.cpp | file | annotate | diff | comparison | revisions |
--- a/toolkit/components/telemetry/pingsender/pingsender_unix_common.cpp +++ b/toolkit/components/telemetry/pingsender/pingsender_unix_common.cpp @@ -172,19 +172,19 @@ static size_t DummyWriteCallback(char* p // If we can't use curl's URL parsing (which is safer) we have to fallback // to this handwritten one (which is only as safe as we are clever.) bool FallbackIsValidDestination(const string& aUrl) { // Lowercase the url string url = aUrl; std::transform(url.begin(), url.end(), url.begin(), [](unsigned char c) { return std::tolower(c); }); // Strip off the scheme in the beginning - if (url.find_first_of("http://") != std::string::npos) { + if (url.find("http://") == 0) { url = url.substr(7); - } else if (url.find_first_of("https://") != std::string::npos) { + } else if (url.find("https://") == 0) { url = url.substr(8); } // Remove any user information. If a @ appeared in the userinformation, // it would need to be encoded. unsigned long atStart = url.find_first_of("@"); url = (atStart == std::string::npos) ? url : url.substr(atStart + 1);