You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2025/10/07 13:08:05 UTC

(tomcat) branch 9.0.x updated: Add test

This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
     new 107fb8f806 Add test
107fb8f806 is described below

commit 107fb8f806c2bd26ee44772a7019d928ab348993
Author: remm <re...@apache.org>
AuthorDate: Tue Oct 7 14:46:04 2025 +0200

    Add test
---
 .../tomcat/util/http/TestCookieProcessorGeneration.java   | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/test/org/apache/tomcat/util/http/TestCookieProcessorGeneration.java b/test/org/apache/tomcat/util/http/TestCookieProcessorGeneration.java
index 7d698c8aac..136c1100e2 100644
--- a/test/org/apache/tomcat/util/http/TestCookieProcessorGeneration.java
+++ b/test/org/apache/tomcat/util/http/TestCookieProcessorGeneration.java
@@ -21,6 +21,8 @@ import javax.servlet.http.Cookie;
 import org.junit.Assert;
 import org.junit.Test;
 
+import org.apache.tomcat.util.descriptor.web.Constants;
+
 public class TestCookieProcessorGeneration {
 
     @Test
@@ -343,6 +345,19 @@ public class TestCookieProcessorGeneration {
         rfc6265.setPartitioned(true);
 
         Assert.assertEquals("foo=bar; Secure; HttpOnly; Partitioned", rfc6265.generateHeader(cookie, null));
+
+        rfc6265.setPartitioned(false);
+        cookie.setAttribute(Constants.COOKIE_PARTITIONED_ATTR, "true");
+
+        Assert.assertEquals("foo=bar; Secure; HttpOnly; Partitioned", rfc6265.generateHeader(cookie, null));
+
+        cookie.setAttribute(Constants.COOKIE_PARTITIONED_ATTR, "false");
+
+        Assert.assertEquals("foo=bar; Secure; HttpOnly", rfc6265.generateHeader(cookie, null));
+
+        cookie.setAttribute(Constants.COOKIE_PARTITIONED_ATTR, "");
+
+        Assert.assertEquals("foo=bar; Secure; HttpOnly", rfc6265.generateHeader(cookie, null));
     }
 
 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org