mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2026-12-05 22:18:27 +00:00
Leave ranged set_content responses uncompressed (#2709)
A set_content() response to a request with Range plus Accept-Encoding was sliced before compression, leaving Content-Range describing uncompressed bytes. Serve ranged 206 responses from the identity representation, as static files already are, by deciding no content coding for a partial response. Close #2709
This commit is contained in:
1 parent
6c2324ee59
commit
c438858d92
2 files changed
+17
-2
No files matched your search
@@ -16100,8 +16100,9 @@ inline void Server::apply_ranges(const Request &req, Response &res,
|
||||
"multipart/byteranges; boundary=" + boundary);
|
||||
}
|
||||
|
||||
auto type =
|
||||
compress_ ? detail::encoding_type(req, res) : detail::EncodingType::None;
|
||||
auto type = compress_ && !detail::is_partial_content(req, res)
|
||||
? detail::encoding_type(req, res)
|
||||
: detail::EncodingType::None;
|
||||
|
||||
if (res.body.empty()) {
|
||||
if (res.content_length_ > 0 && req.ranges.size() == 1 &&
|
||||
|
||||
Reference in new issue
Block a user