cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: [CXF-6832] Supporting Content-Disposition headers with dashes
Date Wed, 16 Mar 2016 16:07:01 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.1.x-fixes 7a35d3314 -> cd62f0a6c


[CXF-6832] Supporting Content-Disposition headers with dashes


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/cd62f0a6
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/cd62f0a6
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/cd62f0a6

Branch: refs/heads/3.1.x-fixes
Commit: cd62f0a6cce4dbfb83fa3af4d35fd1ccf1a701c3
Parents: 7a35d33
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Wed Mar 16 16:05:31 2016 +0000
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Wed Mar 16 16:06:39 2016 +0000

----------------------------------------------------------------------
 .../java/org/apache/cxf/attachment/ContentDisposition.java    | 2 +-
 .../cxf/jaxrs/ext/multipart/ContentDispositionTest.java       | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/cd62f0a6/core/src/main/java/org/apache/cxf/attachment/ContentDisposition.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/attachment/ContentDisposition.java b/core/src/main/java/org/apache/cxf/attachment/ContentDisposition.java
index 330822d..f7cfd97 100644
--- a/core/src/main/java/org/apache/cxf/attachment/ContentDisposition.java
+++ b/core/src/main/java/org/apache/cxf/attachment/ContentDisposition.java
@@ -28,7 +28,7 @@ import java.util.regex.Pattern;
 
 public class ContentDisposition {
     private static final String CD_HEADER_PARAMS_EXPRESSION =
-        "(([\\w]+( )?\\*?=( )?\"[^\"]+\")|([\\w]+( )?\\*?=( )?[^;]+))";
+        "(([\\w-]+( )?\\*?=( )?\"[^\"]+\")|([\\w-]+( )?\\*?=( )?[^;]+))";
     private static final Pattern CD_HEADER_PARAMS_PATTERN =
             Pattern.compile(CD_HEADER_PARAMS_EXPRESSION);
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/cd62f0a6/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/ext/multipart/ContentDispositionTest.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/ext/multipart/ContentDispositionTest.java
b/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/ext/multipart/ContentDispositionTest.java
index bae9020..bd89162 100644
--- a/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/ext/multipart/ContentDispositionTest.java
+++ b/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/ext/multipart/ContentDispositionTest.java
@@ -47,4 +47,11 @@ public class ContentDispositionTest extends Assert {
         assertEquals("baz1", cd.getParameter("baz"));
     }
     
+    @Test
+    public void testContentDispositionWithCreationDate() {
+        ContentDisposition cd = new ContentDisposition(" attachment ; creation-date=\"21:08:08
14:00:00\"");
+        assertEquals("attachment", cd.getType());
+        assertEquals("21:08:08 14:00:00", cd.getParameter("creation-date"));
+    }
+    
 }


Mime
View raw message