From: Jesse Hathaway Date: Fri, 6 Mar 2015 20:16:15 +0000 (+0000) Subject: MEDIUM: http: Compress HTTP responses with status codes 201,202,203 in addition to 200 X-Git-Tag: v1.6-dev1~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2468d4e4f73b57d22d22b02fbb734f7ea09b857c;p=thirdparty%2Fhaproxy.git MEDIUM: http: Compress HTTP responses with status codes 201,202,203 in addition to 200 It is common for rest applications to return status codes other than 200, so compress the other common 200 level responses which might contain content. --- diff --git a/src/proto_http.c b/src/proto_http.c index 56c5364608..611a8c1948 100644 --- a/src/proto_http.c +++ b/src/proto_http.c @@ -2362,8 +2362,11 @@ int select_compression_response_header(struct session *s, struct buffer *res) if (!(msg->flags & HTTP_MSGF_VER_11) || !(txn->req.flags & HTTP_MSGF_VER_11)) goto fail; - /* 200 only */ - if (txn->status != 200) + /* compress 200,201,202,203 responses only */ + if ((txn->status != 200) && + (txn->status != 201) && + (txn->status != 202) && + (txn->status != 203)) goto fail; /* Content-Length is null */