From: Justin Erenkrantz Date: Fri, 18 May 2007 05:57:45 +0000 (+0000) Subject: mod_headers: Allow % at the end of a Header value. PR 36609. X-Git-Tag: 2.2.5~215 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ee2d2fece0db8b3bad9215ba701d4644c3e7bb2b;p=thirdparty%2Fapache%2Fhttpd.git mod_headers: Allow % at the end of a Header value. PR 36609. (Backport of r490156, r499567) Reviewed by: niq, rpluem, wrowe git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@539271 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 1d4fca1e241..e97077ffeed 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes with Apache 2.2.5 + *) mod_headers: Allow % at the end of a Header value. PR 36609. + [Nick Kew, Ruediger Pluem] + *) mod_cache: Use the same cache key throughout the whole request processing to handle escaped URLs correctly. PR 41475. [Ruediger Pluem] diff --git a/modules/metadata/mod_headers.c b/modules/metadata/mod_headers.c index 34174a1809c..e139b5db9f3 100644 --- a/modules/metadata/mod_headers.c +++ b/modules/metadata/mod_headers.c @@ -305,11 +305,13 @@ static char *parse_format_tag(apr_pool_t *p, format_tag *tag, const char **sa) } s++; /* skip the % */ - /* Pass through %% as % */ - if (*s == '%') { + /* Pass through %% or % at end of string as % */ + if ((*s == '%') || (*s == '\0')) { tag->func = constant_item; tag->arg = "%"; - *sa = ++s; + if (*s) + s++; + *sa = s; return NULL; }