| 55 | // --- string utilities --- |
| 56 | |
| 57 | std::string to_lower_copy(std::string s) { |
| 58 | std::transform(s.begin(), s.end(), s.begin(), [](unsigned char c) { |
| 59 | return static_cast<char>(std::tolower(c)); |
| 60 | }); |
| 61 | return s; |
| 62 | } |
| 63 | |
| 64 | bool starts_with_http(const std::string &url) { |
| 65 | return url.rfind("http://", 0) == 0 || url.rfind("https://", 0) == 0; |
no test coverage detected