]> granicus.if.org Git - apache/commitdiff
mod_proxy_fcgi: allow setting empty variables in ProxyFCGISetEnvIf
authorJacob Champion <jchampion@apache.org>
Thu, 9 Feb 2017 23:59:15 +0000 (23:59 +0000)
committerJacob Champion <jchampion@apache.org>
Thu, 9 Feb 2017 23:59:15 +0000 (23:59 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1782419 13f79535-47bb-0310-9956-ffa450edef68

modules/proxy/mod_proxy_fcgi.c

index 1c26e87c8e43ab2835013ee4ef499538981ccbb6..bddb03e6a77cbafa5198c35e6825ec5f4277fd45 100644 (file)
@@ -1138,6 +1138,11 @@ static const char *cmd_setenv(cmd_parms *cmd, void *in_dconf,
     sei_entry *new;
     const char *envvar = arg2;
 
+    /* A missing expr-value should be treated as empty. */
+    if (!arg3) {
+        arg3 = "";
+    }
+
     new = apr_array_push(dconf->env_fixups);
     new->cond = ap_expr_parse_cmd(cmd, arg1, 0, &err, NULL);
     if (err) {
@@ -1163,7 +1168,7 @@ static void register_hooks(apr_pool_t *p)
 static const command_rec command_table[] = {
     AP_INIT_TAKE1("ProxyFCGIBackendType", cmd_servertype, NULL, OR_FILEINFO,
                   "Specify the type of FastCGI server: 'Generic', 'FPM'"),
-    AP_INIT_TAKE3("ProxyFCGISetEnvIf", cmd_setenv, NULL, OR_FILEINFO,
+    AP_INIT_TAKE23("ProxyFCGISetEnvIf", cmd_setenv, NULL, OR_FILEINFO,
                   "expr-condition env-name expr-value"),
     { NULL }
 };