From: André Malo Date: Sun, 18 Apr 2004 19:55:20 +0000 (+0000) Subject: allow env clauses also for 'echo' and 'unset' X-Git-Tag: pre_ajp_proxy~350 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d2dd505a5ff4e2982485626add7441118770afe0;p=apache allow env clauses also for 'echo' and 'unset' git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@103445 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 5147ae5220..151799b6b0 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,9 @@ Changes with Apache 2.1.0-dev [Remove entries to the current 2.0 section below, when backported] + *) mod_headers: Allow env clauses also for 'echo' and 'unset' actions. + [André Malo] + *) mod_headers: Allow 'echo' also for ErrorHeaders. [André Malo] *) mod_headers no longer crashes if an empty header value should diff --git a/modules/metadata/mod_headers.c b/modules/metadata/mod_headers.c index bcdb436ead..779c4e9a69 100644 --- a/modules/metadata/mod_headers.c +++ b/modules/metadata/mod_headers.c @@ -386,15 +386,25 @@ static APR_INLINE const char *header_inout_cmd(cmd_parms *cmd, "'echo'."; if (new->action == hdr_unset) { - if (value) - return "header unset takes two arguments"; + if (value) { + if (envclause) { + return "header unset takes two arguments"; + } + envclause = value; + value = NULL; + } } else if (new->action == hdr_echo) { regex_t *regex; - if (value) - return "Header echo takes two arguments"; - else if (cmd->info != &hdr_out && cmd->info != &hdr_err) + if (value) { + if (envclause) { + return "Header echo takes two arguments"; + } + envclause = value; + value = NULL; + } + if (cmd->info != &hdr_out && cmd->info != &hdr_err) return "Header echo only valid on Header and ErrorHeader " "directives"; else {