NetServices: When the response Content-Length is 0, do not expect a body.
Change-Id: Ia715b44289dc3c64c2b834f954421413cbc3593c
This commit is contained in:
@@ -950,6 +950,8 @@ BHttpSession::Request::ReceiveResult()
|
|||||||
try {
|
try {
|
||||||
auto contentLength = std::string(header->Value());
|
auto contentLength = std::string(header->Value());
|
||||||
fBodyBytesTotal = std::stol(contentLength);
|
fBodyBytesTotal = std::stol(contentLength);
|
||||||
|
if (fBodyBytesTotal == 0)
|
||||||
|
fNoContent = true;
|
||||||
} catch (const std::logic_error& e) {
|
} catch (const std::logic_error& e) {
|
||||||
throw BNetworkRequestError(__PRETTY_FUNCTION__, BNetworkRequestError::ProtocolError);
|
throw BNetworkRequestError(__PRETTY_FUNCTION__, BNetworkRequestError::ProtocolError);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user