mirror of
https://github.com/yhirose/cpp-httplib
synced 2024-11-21 06:26:02 -07:00
Fix #1788
This commit is contained in:
parent
9c91b6f4a6
commit
6cdd3493a1
1 changed files with 8 additions and 0 deletions
|
@ -7720,6 +7720,14 @@ inline bool ClientImpl::process_request(Stream &strm, Request &req,
|
|||
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;
|
||||
if (!detail::read_content(strm, res, (std::numeric_limits<size_t>::max)(),
|
||||
dummy_status, std::move(progress), std::move(out),
|
||||
|
|
Loading…
Reference in a new issue