You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by se...@apache.org on 2016/03/16 17:05:47 UTC
cxf git commit: [CXF-6832] Supporting Content-Disposition headers
with dashes
Repository: cxf
Updated Branches:
refs/heads/master 7098ccba6 -> f492f92e5
[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/f492f92e
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/f492f92e
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/f492f92e
Branch: refs/heads/master
Commit: f492f92e56c12db3d2d06a1613804d269434db3e
Parents: 7098ccb
Author: Sergey Beryozkin <sb...@gmail.com>
Authored: Wed Mar 16 16:05:31 2016 +0000
Committer: Sergey Beryozkin <sb...@gmail.com>
Committed: Wed Mar 16 16:05:31 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/f492f92e/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/f492f92e/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"));
+ }
+
}