Check compressed responses


Multiple encoding formats can be applied to data.
Example:  Content-Encoding: gzip, deflate
According to RFC2616:
  "If multiple encodings have been applied to an entity, the content
   codings MUST be listed in the order in which they were applied."
   https://datatracker.ietf.org/doc/html/rfc2616#section-14.11
  => Header order = compression order (first listed = first applied)
Which means decoding should reverse that order.

In HttpRequest.cpp.mustache:
*) In parseResponse():
  - Iterate over encodings in reverse order and call decompress().

*) Refactor decompress():
  - take 'compressionType' as a parameter.
  - Add warnings for unsupported encodings (for now).
  - Move gzip and deflate decompression logic to a separate function.
*) Add encodingFormatToCompressionType() to get the CompressionType
out of a QString encoding format.

Previously, decompression was applied only for gzip and deflate and
the logic supported only these two encoding formats.

NB: Decompression logic should be revised separately from this change.
TODO:
  Add Brotli and Zstandard encodings support. (QTBUG-141056)

In generate.sh:
- Set contentCompression additional property to true for responses
spec.

For test purposes:
- In yaml file: Add Content-Encoding header in a json object response.
- In server: Update ApplicationJsonObjectResponse() to send a
double-compressed json: first gzip, then deflate.
- In Response.cpp tests: Nothing should change because the result
should remain the same. The response is now sent compressed and
decompressed during parsing.

Task-number: QTBUG-139852
Change-Id: Ifefab2989ea9bc5e1ebbcc5d8ccd21d3abb4e9c6
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
commit460d1c5117b9ebca93ac7a79035de7bf1b0cb550
parent6be9011c18d7ac554b2706b29efc597c067817f8
authorRym Bouabid <rym.bouabid@qt.io>
committerRym Bouabid <rym.bouabid@qt.io>
commit timeThu, 6 Nov 2025 09:52:48 +0100