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.
This commit is contained in:
Willy Tarreau 2013-12-24 14:41:35 +01:00
parent 068621e4ad
commit 72575509ca

View File

@ -2143,7 +2143,7 @@ int select_compression_response_header(struct session *s, struct buffer *res)
goto fail; goto fail;
/* HTTP < 1.1 should not be compressed */ /* 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; goto fail;
/* 200 only */ /* 200 only */