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

thiagohp pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tapestry-5.git


The following commit(s) were added to refs/heads/master by this push:
     new 7645f7e90 Tweaking ContentType's parser regular expression.
7645f7e90 is described below

commit 7645f7e90a9ac579caba98ee67c088058afff4c4
Author: Thiago H. de Paula Figueiredo <[email protected]>
AuthorDate: Tue May 31 21:33:34 2022 -0300

    Tweaking ContentType's parser regular expression.
---
 .../src/test/java/org/apache/tapestry5/root/ContentTypeTest.java      | 4 ++--
 .../src/main/java/org/apache/tapestry5/http/ContentType.java          | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/tapestry-core/src/test/java/org/apache/tapestry5/root/ContentTypeTest.java 
b/tapestry-core/src/test/java/org/apache/tapestry5/root/ContentTypeTest.java
index 00842acad..6082aa49d 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/root/ContentTypeTest.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/root/ContentTypeTest.java
@@ -155,10 +155,10 @@ public class ContentTypeTest extends TestBase
         assertEquals(charset.toString(), "text/html;charset=utf-8");
     }
     
-    @Test(timeOut = 100, expectedExceptions = IllegalArgumentException.class)
+    @Test(timeOut = 750, expectedExceptions = IllegalArgumentException.class)
     public void constructor_timeout() throws Exception
     {
-        new 
ContentType("a/a;a=:;a=:;a=:;a=:;a=:;a=:;a=:;a=:;a=:;a=:;a=:;a=:;a=:;a=:;a=:;a=:;a=:;a=:;a=:;a=:;a=:;a=:;a=:;a=:;a=:;a=:;a=:;a=:;a=:;a=:;");
+        new 
ContentType("a/a;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=:;a/=
 [...]
     }
     
 }
diff --git 
a/tapestry-http/src/main/java/org/apache/tapestry5/http/ContentType.java 
b/tapestry-http/src/main/java/org/apache/tapestry5/http/ContentType.java
index bf1b75cf8..df57d2263 100644
--- a/tapestry-http/src/main/java/org/apache/tapestry5/http/ContentType.java
+++ b/tapestry-http/src/main/java/org/apache/tapestry5/http/ContentType.java
@@ -39,7 +39,7 @@ public final class ContentType
 
     private final Map<String, String> parameters;
 
-    private static final Pattern PATTERN = 
Pattern.compile("^(.+)/([^;]+)(;(.+=[^;]+)){0,5}$");
+    private static final Pattern PATTERN = 
Pattern.compile("^(.+)/([^;]+)(;(.+=[^;]+)){0,3}$");
 
     /**
      * Creates a new content type from the argument. The format of the 
argument has to be basetype/subtype(;key=value)*

Reply via email to