Closed nuferron closed 1 month ago
fixed! urlDecode is now in Response, but should be in Request. I'll close the issue then
I'll leave this here so it won't be lost
std::string Response::urlDecode(const std::string &encoded)
{
std::string decoded;
size_t len = encoded.size();
for (size_t i = 0; i < len; i++)
{
if (encoded[i] == '%')
{
decoded += static_cast<char>(strToHex(encoded.substr(i + 1, 2)));
i += 2;
}
else if (encoded[i] == '+')
decoded += ' ';
else
decoded += encoded[i];
}
return (decoded);
}
discuss what to do and implement it (in case implementation is need it)