This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 2c9d5c5aa7320331f773cb96bede3bb425c44449 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