You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2024/01/08 20:13:32 UTC
(tomcat) branch main updated (d24302cb12 -> a851f66e18)
This is an automated email from the ASF dual-hosted git repository.
markt pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git
from d24302cb12 Don't test lazy vs full as they can be quite close
new 9fd4c840f8 A null value should remove the attribute
new a851f66e18 Running tests locally found threshold needed to be increased
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
java/jakarta/servlet/http/Cookie.java | 6 +++++-
.../apache/tomcat/util/http/TestCookieProcessorGeneration.java | 8 ++++++++
.../tomcat/websocket/server/TestAsyncMessagesPerformance.java | 2 +-
webapps/docs/changelog.xml | 8 ++++++++
4 files changed, 22 insertions(+), 2 deletions(-)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
(tomcat) 01/02: A null value should remove the attribute
Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 9fd4c840f8726551915b93080ed5dcf926eb5a1c
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Mon Jan 8 19:29:49 2024 +0000
A null value should remove the attribute
---
java/jakarta/servlet/http/Cookie.java | 6 +++++-
.../apache/tomcat/util/http/TestCookieProcessorGeneration.java | 8 ++++++++
webapps/docs/changelog.xml | 8 ++++++++
3 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/java/jakarta/servlet/http/Cookie.java b/java/jakarta/servlet/http/Cookie.java
index 4fc87e5516..22ddc5d3ff 100644
--- a/java/jakarta/servlet/http/Cookie.java
+++ b/java/jakarta/servlet/http/Cookie.java
@@ -409,7 +409,11 @@ public class Cookie implements Cloneable, Serializable {
}
}
- attributes.put(name, value);
+ if (value == null) {
+ attributes.remove(name);
+ } else {
+ attributes.put(name, value);
+ }
}
diff --git a/test/org/apache/tomcat/util/http/TestCookieProcessorGeneration.java b/test/org/apache/tomcat/util/http/TestCookieProcessorGeneration.java
index 43ac4d0ffd..3079f423f8 100644
--- a/test/org/apache/tomcat/util/http/TestCookieProcessorGeneration.java
+++ b/test/org/apache/tomcat/util/http/TestCookieProcessorGeneration.java
@@ -95,6 +95,14 @@ public class TestCookieProcessorGeneration {
doTest(cookie, "foo=" + value);
}
+ @Test
+ public void valueNull() {
+ Cookie cookie = new Cookie("foo", "bar");
+ cookie.setAttribute("other", "anything");
+ cookie.setAttribute("other", null);
+ doTest(cookie, "foo=bar");
+ }
+
@Test
public void testMaxAgePositive() {
doTestMaxAge(100, "foo=bar; Max-Age=100");
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 7d752ad772..da9d7b705d 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -105,6 +105,14 @@
issues do not "pop up" wrt. others).
-->
<section name="Tomcat 11.0.0-M17 (markt)" rtext="in development">
+ <subsection name="Coyote">
+ <changelog>
+ <fix>
+ Setting a <code>null</code> value for a cookie attribute should remove
+ the attribute. (markt)
+ </fix>
+ </changelog>
+ </subsection>
</section>
<section name="Tomcat 11.0.0-M16 (markt)" rtext="release in progress">
<subsection name="Catalina">
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
(tomcat) 02/02: Running tests locally found threshold needed to be increased
Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit a851f66e18ed6bbb3a28a8974aed626bb77f5ee9
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Mon Jan 8 20:13:13 2024 +0000
Running tests locally found threshold needed to be increased
---
.../apache/tomcat/websocket/server/TestAsyncMessagesPerformance.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/org/apache/tomcat/websocket/server/TestAsyncMessagesPerformance.java b/test/org/apache/tomcat/websocket/server/TestAsyncMessagesPerformance.java
index 5304bee2ca..d4c7d3cb64 100644
--- a/test/org/apache/tomcat/websocket/server/TestAsyncMessagesPerformance.java
+++ b/test/org/apache/tomcat/websocket/server/TestAsyncMessagesPerformance.java
@@ -151,7 +151,7 @@ public class TestAsyncMessagesPerformance extends TomcatBaseTest {
if (seqZeroTimingFailureCount > 1) {
// The 50ms pause after the short message may very rarely appear to be less than 40ms
fail = true;
- } else if (seqOneTimingFailureCount > 5) {
+ } else if (seqOneTimingFailureCount > 10) {
// The two chunks of the 16k message may rarely be more than 0.5ms apart
fail = true;
} else if (seqTwoTimingFailureCount > 100) {
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org