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:
- read the request header
- check if there is an
Accept-Encoding
header present - if true, set a
Content-Encoding
header on the response - call the user request handler callback
- before the response body is written, check if a
Content-Encoding
header is present - if true, wrap the response output stream in the proper
GzipOutputStream
or similar - 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.