Fix erroneous error when HTTP body_limit is none

fixes #2070
closes #2073
This commit is contained in:
Richard Hodges committed 2020-08-28 13:26:59 +02:00
1 parent d04ff199bb
commit 9e6822773e
3 files changed
+24 -3

No files matched your search

@@ -447,7 +447,8 @@ finish_header(error_code& ec, std::true_type)
}
else if(f_ & flagContentLength)
{
if(len_ > body_limit_)
if(body_limit_.has_value() &&
len_ > body_limit_)
{
ec = error::body_limit;
return;
@@ -511,7 +512,8 @@ finish_header(error_code& ec, std::false_type)
f_ |= flagHasBody;
state_ = state::body0;
if(len_ > body_limit_)
if(body_limit_.has_value() &&
len_ > body_limit_)
{
ec = error::body_limit;
return;