Fix #1998
This commit is contained in:
parent
3e86bdb4d8
commit
11a40584e9
10
httplib.h
10
httplib.h
@ -7964,7 +7964,9 @@ inline bool ClientImpl::process_request(Stream &strm, Request &req,
|
|||||||
// Body
|
// Body
|
||||||
if ((res.status != StatusCode::NoContent_204) && req.method != "HEAD" &&
|
if ((res.status != StatusCode::NoContent_204) && req.method != "HEAD" &&
|
||||||
req.method != "CONNECT") {
|
req.method != "CONNECT") {
|
||||||
auto redirect = 300 < res.status && res.status < 400 && follow_location_;
|
auto redirect = 300 < res.status && res.status < 400 &&
|
||||||
|
res.status != StatusCode::NotModified_304 &&
|
||||||
|
follow_location_;
|
||||||
|
|
||||||
if (req.response_handler && !redirect) {
|
if (req.response_handler && !redirect) {
|
||||||
if (!req.response_handler(res)) {
|
if (!req.response_handler(res)) {
|
||||||
@ -8008,14 +8010,16 @@ inline bool ClientImpl::process_request(Stream &strm, Request &req,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (res.status != StatusCode::NotModified_304) {
|
||||||
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),
|
||||||
decompress_)) {
|
std::move(out), decompress_)) {
|
||||||
if (error != Error::Canceled) { error = Error::Read; }
|
if (error != Error::Canceled) { error = Error::Read; }
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Log
|
// Log
|
||||||
if (logger_) { logger_(req, res); }
|
if (logger_) { logger_(req, res); }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user