NetServices: When the response Content-Length is 0, do not expect a body.

Change-Id: Ia715b44289dc3c64c2b834f954421413cbc3593c
This commit is contained in:
Niels Sascha Reedijk 2022-06-26 16:04:58 +01:00
parent 92357c131e
commit 6cf088266f

View File

@ -950,6 +950,8 @@ BHttpSession::Request::ReceiveResult()
try {
auto contentLength = std::string(header->Value());
fBodyBytesTotal = std::stol(contentLength);
if (fBodyBytesTotal == 0)
fNoContent = true;
} catch (const std::logic_error& e) {
throw BNetworkRequestError(__PRETTY_FUNCTION__, BNetworkRequestError::ProtocolError);
}