mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2026-08-19 16:45:03 +00:00
RFC 9110 Section 5.3 makes a Content-Encoding spread over several field lines the same message as the comma-joined one, so the two have to be read the same way. Reading occurrence zero did not: a response carrying "gzip" on two field lines was decoded as a single gzip coding, so a body the sender says was encoded twice came back after one pass -- still compressed, but presented to the caller as decoded. The same value written as "gzip, gzip" on one line took the pass-through path instead. Read the combined value at both sites. A value naming several codings matches none of the ones cpp-httplib implements, so both representations now take the pass-through path that prepare_content_receiver() already documents for an unrecognized coding. This does mean a sender that repeats "Content-Encoding: gzip" on two lines for a body it gzipped once no longer has that body decoded. There is no way to tell that sender apart from one that really did encode twice, and the conservative reading is the one the field value states.