Catch non-numeric size and ignore it
This commit is contained in:
parent
69579902e2
commit
df50807eeb
|
@ -47,15 +47,21 @@ const Request http::parse_request(const string &request)
|
|||
{
|
||||
answer = get_parameter(request, "s");
|
||||
if (!answer.empty())
|
||||
{
|
||||
try
|
||||
{
|
||||
size = static_cast<uint16_t>(std::stoul(answer));
|
||||
} catch (const std::exception &) {}
|
||||
}
|
||||
else
|
||||
{
|
||||
answer = get_parameter(request, "size");
|
||||
if (!answer.empty())
|
||||
{
|
||||
try
|
||||
{
|
||||
size = static_cast<uint16_t>(std::stoul(answer));
|
||||
} catch (const std::exception &) {}
|
||||
}
|
||||
}
|
||||
if (size > 512)
|
||||
|
|
Loading…
Reference in New Issue