You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by ff...@apache.org on 2017/10/16 05:18:57 UTC

[cxf] branch 3.1.x-fixes updated: [CXF-7530]AttachmentSerializer miss a CRLF before the multipart-body per spec rfc2046

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

ffang pushed a commit to branch 3.1.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git


The following commit(s) were added to refs/heads/3.1.x-fixes by this push:
     new fab8df3  [CXF-7530]AttachmentSerializer miss a CRLF before the multipart-body per spec rfc2046
fab8df3 is described below

commit fab8df3191418ee8ffd995907a38a0f933931bea
Author: Freeman Fang <fr...@gmail.com>
AuthorDate: Mon Oct 16 11:23:58 2017 +0800

    [CXF-7530]AttachmentSerializer miss a CRLF before the multipart-body per spec rfc2046
    
    (cherry picked from commit de14153b20f4018d5ff48a5f8d95e31aab93417f)
---
 core/src/main/java/org/apache/cxf/attachment/AttachmentSerializer.java  | 1 +
 .../java/org/apache/cxf/ws/rm/persistence/PersistenceUtilsTest.java     | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/core/src/main/java/org/apache/cxf/attachment/AttachmentSerializer.java b/core/src/main/java/org/apache/cxf/attachment/AttachmentSerializer.java
index c9878f8..1599407 100644
--- a/core/src/main/java/org/apache/cxf/attachment/AttachmentSerializer.java
+++ b/core/src/main/java/org/apache/cxf/attachment/AttachmentSerializer.java
@@ -157,6 +157,7 @@ public class AttachmentSerializer {
             encoding = StandardCharsets.UTF_8.name();
         }
         StringWriter writer = new StringWriter();
+        writer.write("\r\n");
         writer.write("--");
         writer.write(bodyBoundary);
         
diff --git a/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/persistence/PersistenceUtilsTest.java b/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/persistence/PersistenceUtilsTest.java
index 9cccd2a..7553434 100644
--- a/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/persistence/PersistenceUtilsTest.java
+++ b/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/persistence/PersistenceUtilsTest.java
@@ -96,7 +96,7 @@ public class PersistenceUtilsTest extends Assert {
         // update rmmessage
         PersistenceUtils.encodeRMContent(rmmsg, messageImpl, bis);
 
-        assertStartsWith(rmmsg.getContent().getInputStream(), "--uuid:");
+        assertStartsWith(rmmsg.getContent().getInputStream(), "\r\n--uuid:");
         assertNotNull(rmmsg.getContentType());
         assertTrue(rmmsg.getContentType().startsWith("multipart/related"));
     }

-- 
To stop receiving notification emails like this one, please contact
['"commits@cxf.apache.org" <co...@cxf.apache.org>'].