]> granicus.if.org Git - apache/commitdiff
allow %% to represent a literal %.
authorAndré Malo <nd@apache.org>
Sun, 18 Apr 2004 20:26:07 +0000 (20:26 +0000)
committerAndré Malo <nd@apache.org>
Sun, 18 Apr 2004 20:26:07 +0000 (20:26 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@103446 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/metadata/mod_headers.c

diff --git a/CHANGES b/CHANGES
index 151799b6b0c894979d4f8e0327363e805c8624cb..d5780ab1bf4e072479572f15d338ce38e2ae02f7 100644 (file)
--- 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]
 
index 779c4e9a692a7f2d00e3c4e93556d28e72c134eb..9e6c0ba7c65ee143a192997ca057dee509bfcf31 100644 (file)
@@ -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;