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

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

commit da3437d1a4c7955beb4cb7d9393d704f5c37a3af
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Mon Aug 1 12:31:01 2022 +0100

    Add test empty parameter - allowed by RFC 9110
    
    Tomcat already allowed this so no functional change.
---
 test/org/apache/tomcat/util/http/parser/TestMediaType.java | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/test/org/apache/tomcat/util/http/parser/TestMediaType.java 
b/test/org/apache/tomcat/util/http/parser/TestMediaType.java
index 9a577687e3..c17d6cd589 100644
--- a/test/org/apache/tomcat/util/http/parser/TestMediaType.java
+++ b/test/org/apache/tomcat/util/http/parser/TestMediaType.java
@@ -314,4 +314,14 @@ public class TestMediaType {
         Assert.assertEquals("2", m.getParameterValue("B"));
         Assert.assertEquals("2", m.getParameterValue("b"));
     }
+
+    @Test
+    public void TestEmptyParameter() throws Exception {
+        // RFC 9110
+        StringReader sr = new StringReader("type/sub-type;;a=1;;b=2;;");
+        MediaType m = MediaType.parseMediaType(sr);
+
+        Assert.assertEquals("1", m.getParameterValue("a"));
+        Assert.assertEquals("2", m.getParameterValue("b"));
+    }
 }


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

Reply via email to