Repository navigation
What's Changed
Behavior changes
- Client: response header fields are read under a new
CPPHTTPLIB_RESPONSE_HEADER_MAX_LENGTH, 32768 by default, instead ofCPPHTTPLIB_HEADER_MAX_LENGTH(8192), which is meant for the request headers a server accepts. Some servers send longer fields: www.youtube.com returns a 13KB one, so every request to it failed withError::Read.
Security-relevant fixes
- Client (streaming): with a zero payload limit, a read from
stream::*oropen_stream()decompressed everything it had read into memory with no bound, so a small compressed response could exhaust the client's memory.SSEClienthas read its stream with a zero limit since v0.62.0, so it was affected with default settings when built with Brotli or zstd support. A single read is now kept withinCPPHTTPLIB_PAYLOAD_MAX_LENGTH, while the stream as a whole stays unbounded.
Bug fixes
- gzip: every member of a multi-member gzip body is decoded (#2710, RFC 1952 2.2). Decoding stopped at the end of the first member, so the body came back cut short with no error.
- Server: a ranged
set_content()response to a request withAccept-Encodingis left uncompressed (#2709). It was sliced before compression, soContent-Rangedescribed the uncompressed bytes. Partial responses are now served from the identity representation, as static files already are. - Server: a
Rangeheader in which some ranges start past the end of the body is served from the remaining ranges instead of being answered with 416 (#2703, RFC 9110 14.1.1). 416 is still returned when no range is satisfiable. - Server: an
If-Rangedate must matchLast-Modifiedexactly (#2707, RFC 9110 13.1.5). A date later thanLast-Modifiedused to be accepted too. - Client: the redirect host is compared case-insensitively (#2708), so a redirect to the same host written in a different case reuses the current client.
- Multipart: a
filename*parameter with a language tag, such asUTF-8'en'..., is accepted (#2704, RFC 8187). It used to make the whole body invalid, and the request got 400. - Windows:
FileStatuses the 64-bit_wstat64(#2705), soset_mount_pointserves files of 2 GiB or more instead of returning 404.
Other
- Fuzzing: added
chunked_decoder_fuzzerand a seed corpus formultipart_parser_fuzzer(#2706).
Full Changelog: v0.69.0...v0.70.0