Am 17.11.2013 02:05, schrieb Alexey Kulentsov:

On Fri, 15 Nov 2013 14:50:47 GMT, Sönke Ludwig wrote:

Currently there is no setting to disable it, but you can do if ("Content-Encoding" in res.headers) res.headers.remove("Content-Encoding"); on the response object to disable compression.

Therefore, control of the output stream through an array of headers? The solution is not obvious to me. Thanks!

The HTTP server works like this regarding compression:

  1. read the request header
  2. check if there is an Accept-Encoding header present
  3. if true, set a Content-Encoding header on the response
  4. call the user request handler callback
  5. before the response body is written, check if a Content-Encoding
    header is present
  6. if true, wrap the response output stream in the proper
    GzipOutputStream or similar
  7. write the response body

It's done like this to ensure that response headers are always
consistent with the actual encoding/compression used to send the data.