This is an automated email from the ASF dual-hosted git repository.
schultz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/main by this push:
new cbefe8624e Fix disastrous cookie-logging patch.
cbefe8624e is described below
commit cbefe8624ee5d6255955134d08498f9926295126
Author: Christopher Schultz <[email protected]>
AuthorDate: Fri Apr 19 10:16:36 2024 -0400
Fix disastrous cookie-logging patch.
---
java/org/apache/catalina/valves/AbstractAccessLogValve.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/java/org/apache/catalina/valves/AbstractAccessLogValve.java
b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
index 0576b83442..dd29a5ec37 100644
--- a/java/org/apache/catalina/valves/AbstractAccessLogValve.java
+++ b/java/org/apache/catalina/valves/AbstractAccessLogValve.java
@@ -1513,17 +1513,19 @@ public abstract class AbstractAccessLogValve extends
ValveBase implements Access
if (cookies != null) {
for (Cookie cookie : cookies) {
if (cookieNameToLog.equals(cookie.getName())) {
+ if (value == null) {
+ value = new StringBuilder();
+ }
if (first) {
first = false;
} else {
value.append(',');
}
- value = new StringBuilder();
value.append(cookie.getValue());
}
}
}
- if (value.length() == 0) {
+ if (value == null) {
buf.append('-');
} else {
escapeAndAppend(value.toString(), buf);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]