This commit is contained in:
yhirose 2024-09-01 01:55:27 -04:00
parent 9c91b6f4a6
commit 6cdd3493a1

View file

@ -7720,6 +7720,14 @@ inline bool ClientImpl::process_request(Stream &strm, Request &req,
return ret; return ret;
}; };
if (res.has_header("Content-Length")) {
if (!req.content_receiver) {
auto len = std::min<size_t>(res.get_header_value_u64("Content-Length"),
res.body.max_size());
if (len > 0) { res.body.reserve(len); }
}
}
int dummy_status; int dummy_status;
if (!detail::read_content(strm, res, (std::numeric_limits<size_t>::max)(), if (!detail::read_content(strm, res, (std::numeric_limits<size_t>::max)(),
dummy_status, std::move(progress), std::move(out), dummy_status, std::move(progress), std::move(out),