From: Willy Tarreau Date: Tue, 24 Dec 2013 13:41:35 +0000 (+0100) Subject: BUG/MINOR: http: always disable compression on HTTP/1.0 X-Git-Tag: v1.5-dev22~89 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=72575509caed8cf12cf8b223d6e72421578417f8;p=thirdparty%2Fhaproxy.git BUG/MINOR: http: always disable compression on HTTP/1.0 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. --- diff --git a/src/proto_http.c b/src/proto_http.c index 624a51fa38..72259c9de2 100644 --- a/src/proto_http.c +++ b/src/proto_http.c @@ -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 */