Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions evpp/httpc/url_parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,19 @@ int URLParser::parse(const string& url_s) {
it = search(url_s.begin(), url_s.end(), prot_end.begin(), prot_end.end());
if (it != url_s.end()) {
schema.reserve(distance(url_s.begin(), it));
transform(url_s.begin(), it, back_inserter(schema), ptr_fun<int, int>(tolower)); // protocol is icase
transform(url_s.begin(), it, back_inserter(schema), [](int x) { // protocol is icase
return tolower(x);
});
advance(it, prot_end.length());
last_it = it;
}

it = find_if(last_it, url_s.end(), equal_key);

host.reserve(distance(last_it, it));
transform(last_it, it, back_inserter(host), ptr_fun<int, int>(tolower)); // host is icase
transform(last_it, it, back_inserter(host), [](int x) { // host is icase
return tolower(x);
});

if (it == url_s.end()) {
return 0;
Expand Down