Hi Vladimir,
Sorry for my late reply, I was pretty busy these last days. I
investigated a little on your problem. I've done some tests and
carefully read the code. Everything seems to work as expected. I was not
able to reproduce what you experienced with HAProxy 1.7.2.
First, in HAProxy, except with a specific configuration, we never remove
any "Transfer-Encoding" headers. And we never add any "Content-Length"
headers. During the HTTP headers parsing, if the "Transfer-Encoding"
header is found with the value "chunked", we remove all "Content-Length"
headers, if any. This is always done, with or without the compression
filter. Then, when the compression is enabled, if the response payload
must be compressed by HAProxy, we remove all "Content-Length" headers
and add "Transfer-Encoding: chunked" if needed.
Then, when the response is truncated, there is no "Content-Encoding"
header. So I'm tempted to think that the GZIP compression is not used on
the response.
So, if there is a bug, it is well hidden (as always with chunked HTTP
payload ...*sigh*...). And it will be hard for me to hunt it without
more information about exchanges between HAProxy and your backend. The
best would be a full-packet network capture. But, if the bug is
reproducible, it can be a good start to have the output of the following
command:
curl -H header_1 -H header_2 ... -v --raw --compress -o raw_response
your_backend_url
Be sure to set same headers than for a request on HAProxy.
If the response contains sensitive information, you can remove them. I
only need to have the chunk sizes.
--
Christopher