Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Not A Problem
-
None
-
None
-
None
Description
Currently, libprocess decides whether a response should be compressed by the following conditional:
if (response.type == http::Response::BODY && response.body.length() >= GZIP_MINIMUM_BODY_LENGTH && !headers.contains("Content-Encoding") && request.acceptsEncoding("gzip")) { [...]
However, this implies that a request sent with the header "Accept-Encoding: gzip" can not rely on actually getting a gzipped response, e.g. when the response size is below the threshold:
$ nc localhost 5050 GET /tasks HTTP/1.1 Accept-Encoding: gzip HTTP/1.1 200 OK Date: Tue, 04 Dec 2018 12:49:56 GMT Content-Type: application/json Content-Length: 12 {"tasks":[]}