]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: fcgi-app: Make the directive pass-header case insensitive
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 2 Dec 2019 09:33:31 +0000 (10:33 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 2 Dec 2019 09:38:52 +0000 (10:38 +0100)
The header name configured by the directive "pass-header", in the "fcgi-app"
section, must be case insensitive. For now, it must be in lowercase to match an
header. Internally, header names are in lowercase but there is no reason to
impose this syntax in the configuration.

This patch must be backported to 2.1.

src/fcgi-app.c

index f33cfb1a78376a88fcf7e3a7ee88f8685da90bae..2e01cdbeb6878634846a241ff9c2fdca65374d20 100644 (file)
@@ -715,8 +715,10 @@ static int fcgi_app_add_rule(struct fcgi_app *curapp, enum fcgi_rule_type type,
                struct ist fname = fcgi_param_name(trash.area, ist(name));
                rule->name = my_strndup(fname.ptr, fname.len);
        }
-       else  /* FCGI_RULE_PASS_HDR/FCGI_RULE_HIDE_HDR */
-               rule->name = strdup(name);
+       else {  /* FCGI_RULE_PASS_HDR/FCGI_RULE_HIDE_HDR */
+               struct ist fname = ist2bin_lc(trash.area, ist(name));
+               rule->name = my_strndup(fname.ptr, fname.len);
+       }
        if (!rule->name)
                goto err;