]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: http: always disable compression on HTTP/1.0
authorWilly Tarreau <w@1wt.eu>
Tue, 24 Dec 2013 13:41:35 +0000 (14:41 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 24 Dec 2013 13:41:35 +0000 (14:41 +0100)
Compression is normally disabled on HTTP/1.0 since it does not
support chunked encoded responses. But the test was incomplete, and
Bertrand Jacquin reported a case where if the server responded using
1.1 to an 1.0 request, then haproxy still used to compress (and of
course the client could not understand the response).

No backport is needed, this is 1.5-specific.

src/proto_http.c

index 624a51fa38c62e35fc0bf0d9fd56705a1d6c5b45..72259c9de2227ede5f59d7dfd2e2193805abb042 100644 (file)
@@ -2143,7 +2143,7 @@ int select_compression_response_header(struct session *s, struct buffer *res)
                goto fail;
 
        /* HTTP < 1.1 should not be compressed */
-       if (!(msg->flags & HTTP_MSGF_VER_11))
+       if (!(msg->flags & HTTP_MSGF_VER_11) || !(txn->req.flags & HTTP_MSGF_VER_11))
                goto fail;
 
        /* 200 only */