From: Stefan Fritsch Date: Mon, 9 Nov 2009 10:43:16 +0000 (+0000) Subject: Also remove trailing whitespace in the value X-Git-Tag: 2.3.3~17 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=16f79b1337ca0b015d2c1e5b2b10122522379c49;p=apache Also remove trailing whitespace in the value git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@834013 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/loggers/mod_log_config.c b/modules/loggers/mod_log_config.c index 29836196fb..b284f76070 100644 --- a/modules/loggers/mod_log_config.c +++ b/modules/loggers/mod_log_config.c @@ -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;