From: Jacob Champion Date: Thu, 9 Feb 2017 23:59:15 +0000 (+0000) Subject: mod_proxy_fcgi: allow setting empty variables in ProxyFCGISetEnvIf X-Git-Tag: 2.5.0-alpha~677 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=457a7235371847d3cff880b943ea204b1af95e61;p=apache mod_proxy_fcgi: allow setting empty variables in ProxyFCGISetEnvIf git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1782419 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/proxy/mod_proxy_fcgi.c b/modules/proxy/mod_proxy_fcgi.c index 1c26e87c8e..bddb03e6a7 100644 --- a/modules/proxy/mod_proxy_fcgi.c +++ b/modules/proxy/mod_proxy_fcgi.c @@ -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 } };