From: André Malo Date: Sun, 18 Apr 2004 20:26:07 +0000 (+0000) Subject: allow %% to represent a literal %. X-Git-Tag: pre_ajp_proxy~349 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f6d2e82e3a0080268e0d401d9ab10fd32bb90747;p=apache allow %% to represent a literal %. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@103446 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 151799b6b0..d5780ab1bf 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 %% in header values to represent a literal %. + [André Malo] + *) mod_headers: Allow env clauses also for 'echo' and 'unset' actions. [André Malo] diff --git a/modules/metadata/mod_headers.c b/modules/metadata/mod_headers.c index 779c4e9a69..9e6c0ba7c6 100644 --- a/modules/metadata/mod_headers.c +++ b/modules/metadata/mod_headers.c @@ -299,6 +299,15 @@ static char *parse_format_tag(apr_pool_t *p, format_tag *tag, const char **sa) return parse_misc_string(p, tag, sa); } s++; /* skip the % */ + + /* Pass through %% as % */ + if (*s == '%') { + tag->func = constant_item; + tag->arg = "%"; + *sa = ++s; + return NULL; + } + tag->arg = '\0'; /* grab the argument if there is one */ if (*s == '{') { @@ -312,8 +321,7 @@ static char *parse_format_tag(apr_pool_t *p, format_tag *tag, const char **sa) char dummy[2]; dummy[0] = s[-1]; dummy[1] = '\0'; - return apr_pstrcat(p, "Unrecognized Header or RequestHeader directive %", - dummy, NULL); + return apr_pstrcat(p, "Unrecognized header format %", dummy, NULL); } tag->func = tag_handler;