| 116 | } |
| 117 | |
| 118 | bool normalize_endpoint(std::string &endpoint, const char *default_path_suffix) { |
| 119 | ParsedUrl parsed; |
| 120 | if (!parse_url(endpoint, parsed)) { |
| 121 | return false; |
| 122 | } |
| 123 | if (parsed.path == L"/") { |
| 124 | if (!endpoint.empty() && endpoint.back() == '/') { |
| 125 | endpoint += default_path_suffix; |
| 126 | } else { |
| 127 | endpoint += '/'; |
| 128 | endpoint += default_path_suffix; |
| 129 | } |
| 130 | } |
| 131 | return parse_url(endpoint, parsed); |
| 132 | } |
| 133 | |
| 134 | bool resolve_endpoint_candidate(const std::string &candidate, std::string &endpoint, |
| 135 | const std::function<bool(const std::string &, std::string &)> &try_alias) { |
no test coverage detected