Set parser status and flags even if body_limit_ has been reached

close #1556
This commit is contained in:
Mohamed El Housseine
2019-04-04 19:19:32 +02:00
committed by Vinnie Falco
parent bc9f63f10d
commit ebe52537ea

View File

@@ -508,15 +508,16 @@ finish_header(error_code& ec, std::false_type)
} }
else if(f_ & flagContentLength) else if(f_ & flagContentLength)
{ {
if(len_ > body_limit_)
{
ec = error::body_limit;
return;
}
if(len_ > 0) if(len_ > 0)
{ {
f_ |= flagHasBody; f_ |= flagHasBody;
state_ = state::body0; state_ = state::body0;
if(len_ > body_limit_)
{
ec = error::body_limit;
return;
}
} }
else else
{ {