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:59 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes e515c1365 -> 0b858a713


[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/0b858a71
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/0b858a71
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/0b858a71

Branch: refs/heads/3.0.x-fixes
Commit: 0b858a7131f329f92446e7dd660da47f353c5aa6
Parents: e515c13
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:07:44 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/0b858a71/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/0b858a71/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