]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
mod_headers: Allow % at the end of a Header value. PR 36609.
authorJustin Erenkrantz <jerenkrantz@apache.org>
Fri, 18 May 2007 05:57:45 +0000 (05:57 +0000)
committerJustin Erenkrantz <jerenkrantz@apache.org>
Fri, 18 May 2007 05:57:45 +0000 (05:57 +0000)
(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

CHANGES
modules/metadata/mod_headers.c

diff --git a/CHANGES b/CHANGES
index 1d4fca1e2410d3df8fdcbbab56784f7fbc81e095..e97077ffeed3ed4613d2f7790fab2504f13ef9ae 100644 (file)
--- 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]
 
index 34174a1809c943f784b13ef4bb4bf11fc957ac5a..e139b5db9f31021603a67f3952cd33165e584759 100644 (file)
@@ -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;
     }