| 127 | } |
| 128 | |
| 129 | String urlDecode(const String &input) { |
| 130 | String output; |
| 131 | output.reserve(input.length()); |
| 132 | for (int i = 0; i < input.length(); ++i) { |
| 133 | char c = input[i]; |
| 134 | if (c == '+') { |
| 135 | output += ' '; |
| 136 | } else if (c == '%' && i + 2 < input.length()) { |
| 137 | char hex[3] = {input[i + 1], input[i + 2], 0}; |
| 138 | output += static_cast<char>(strtol(hex, nullptr, 16)); |
| 139 | i += 2; |
| 140 | } else { |
| 141 | output += c; |
| 142 | } |
| 143 | } |
| 144 | return output; |
| 145 | } |
| 146 | |
| 147 | void parseUrlEncoded(const String &body, WebParamMap ¶ms) { |
| 148 | int start = 0; |
no outgoing calls
no test coverage detected