]> granicus.if.org Git - apache/commitdiff
Also remove trailing whitespace in the value
authorStefan Fritsch <sf@apache.org>
Mon, 9 Nov 2009 10:43:16 +0000 (10:43 +0000)
committerStefan Fritsch <sf@apache.org>
Mon, 9 Nov 2009 10:43:16 +0000 (10:43 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@834013 13f79535-47bb-0310-9956-ffa450edef68

modules/loggers/mod_log_config.c

index 29836196fb95d223cd6a2a076d7931d6b11ef6d5..b284f76070a040f9af36bc53155003f81ea65f05 100644 (file)
@@ -502,7 +502,7 @@ static const char *log_cookie(request_rec *r, char *a)
      * This supports Netscape version 0 cookies while being tolerant to
      * some properties of RFC2109/2965 version 1 cookies:
      * - case-insensitive match of cookie names
-     * - white space around the '='
+     * - white space between the tokens
      * It does not support the following version 1 features:
      * - quoted strings as cookie values
      * - commas to separate cookies
@@ -518,7 +518,14 @@ static const char *log_cookie(request_rec *r, char *a)
             apr_collapse_spaces(name, name);
 
             if (!strcasecmp(name, a) && (value = apr_strtok(NULL, "=", &last2))) {
-                value += strspn(value, " \t");  /* Move past WS */
+                char *last;
+                value += strspn(value, " \t");  /* Move past leading WS */
+                last = value + strlen(value);
+                while (last >= value && apr_isspace(*last)) {
+                   *last = '\0';
+                   --last;
+                }
+
                 return ap_escape_logitem(r->pool, value);
             }
             cookies = NULL;