mirror of
https://github.com/boostorg/beast.git
synced 2025-07-31 05:17:26 +02:00
Fix prepare_payload: chunked is HTTP/1.1
This commit is contained in:
@ -2,6 +2,7 @@ Version 129:
|
|||||||
|
|
||||||
* Add autobahn test report to doc
|
* Add autobahn test report to doc
|
||||||
* Documentation tidying
|
* Documentation tidying
|
||||||
|
* Fix prepare_payload: chunked is HTTP/1.1
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -382,7 +382,7 @@ prepare_payload(std::true_type)
|
|||||||
this->chunked(false);
|
this->chunked(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(this->version() >= 11)
|
else if(this->version() == 11)
|
||||||
{
|
{
|
||||||
this->chunked(true);
|
this->chunked(true);
|
||||||
}
|
}
|
||||||
@ -398,19 +398,21 @@ message<isRequest, Body, Fields>::
|
|||||||
prepare_payload(std::false_type)
|
prepare_payload(std::false_type)
|
||||||
{
|
{
|
||||||
auto const n = payload_size();
|
auto const n = payload_size();
|
||||||
if((status_class(this->result()) == status_class::informational ||
|
if( (! n || *n > 0) && (
|
||||||
|
(status_class(this->result()) == status_class::informational ||
|
||||||
this->result() == status::no_content ||
|
this->result() == status::no_content ||
|
||||||
this->result() == status::not_modified))
|
this->result() == status::not_modified)))
|
||||||
{
|
{
|
||||||
if(! n || *n > 0)
|
// The response body MUST be empty for this case
|
||||||
// The response body MUST be empty for this case
|
BOOST_THROW_EXCEPTION(std::invalid_argument{
|
||||||
BOOST_THROW_EXCEPTION(std::invalid_argument{
|
"invalid response body"});
|
||||||
"invalid response body"});
|
|
||||||
}
|
}
|
||||||
if(n)
|
if(n)
|
||||||
this->content_length(n);
|
this->content_length(n);
|
||||||
else
|
else if(this->version() == 11)
|
||||||
this->chunked(true);
|
this->chunked(true);
|
||||||
|
else
|
||||||
|
this->chunked(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user