]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: compression: Content-Type is case insensitive
authorWilliam Lallemand <wlallemand@exceliance.fr>
Mon, 26 Nov 2012 14:10:39 +0000 (15:10 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 26 Nov 2012 15:02:58 +0000 (16:02 +0100)
The Content-Type parameter must be case insensitive.

src/proto_http.c

index 2b96ca33652a3698fd89d0590569f984df903d5c..d63483ea1f679900a2cf05af2e22282b5a3f3753 100644 (file)
@@ -2078,7 +2078,7 @@ int select_compression_response_header(struct session *s, struct buffer *res)
        if ((s->be->comp && (comp_type = s->be->comp->types)) || (s->fe->comp && (comp_type = s->fe->comp->types))) {
                if (http_find_header2("Content-Type", 12, res->p, &txn->hdr_idx, &ctx)) {
                        for (; comp_type; comp_type = comp_type->next) {
-                               if (strncmp(ctx.line+ctx.val, comp_type->name, comp_type->name_len) == 0)
+                               if (strncasecmp(ctx.line+ctx.val, comp_type->name, comp_type->name_len) == 0)
                                        /* this Content-Type should be compressed */
                                        break;
                        }