| 37 | OPENVPN_EXCEPTION(url_error); |
| 38 | |
| 39 | inline std::string encode(const std::string& str) |
| 40 | { |
| 41 | std::string ret; |
| 42 | ret.reserve(str.length() * 2); // just a guess |
| 43 | for (auto &c : str) |
| 44 | { |
| 45 | if (HTTP::Util::is_escaped(c)) |
| 46 | { |
| 47 | ret += '%'; |
| 48 | ret += render_hex_number((unsigned char)c, true); |
| 49 | } |
| 50 | else |
| 51 | ret += c; |
| 52 | } |
| 53 | return ret; |
| 54 | } |
| 55 | |
| 56 | inline std::string decode(const std::string& encoded) |
| 57 | { |
no test coverage detected