You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by re...@apache.org on 2022/09/18 19:40:06 UTC

[cxf] branch 3.4.x-fixes updated (c81ac5f4cd -> 142c1aa054)

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

reta pushed a change to branch 3.4.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git


    from c81ac5f4cd Recording .gitmergeinfo Changes
     new ccdc4f7d7e Update Jetty to 9.4.49.v20220914
     new 83c20fb20b CXF-8698: Content-ID of attachments for outgoing requests are URL-decoded instead of URL-encoded (limiting decoding only to % encoded characters) (#993)
     new f47c636e1b Recording .gitmergeinfo Changes
     new 142c1aa054 Fixing compilation issues (post CXF-8698 merge)

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .gitmergeinfo                                                 |  2 ++
 .../java/org/apache/cxf/attachment/AttachmentSerializer.java  | 11 +++++++++--
 .../org/apache/cxf/attachment/AttachmentSerializerTest.java   |  5 +++++
 parent/pom.xml                                                |  2 +-
 4 files changed, 17 insertions(+), 3 deletions(-)


[cxf] 02/04: CXF-8698: Content-ID of attachments for outgoing requests are URL-decoded instead of URL-encoded (limiting decoding only to % encoded characters) (#993)

Posted by re...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 83c20fb20beaa8706981c07b746f057ef468750a
Author: Andriy Redko <dr...@gmail.com>
AuthorDate: Sun Sep 18 14:36:00 2022 -0400

    CXF-8698: Content-ID of attachments for outgoing requests are URL-decoded instead of URL-encoded (limiting decoding only to % encoded characters) (#993)
    
    (cherry picked from commit c430bbb87042d4cb6db947820e73be0347a1e203)
    (cherry picked from commit 98797ffa3ed4a2648e462a8cc5dceb84624903ba)
---
 .../java/org/apache/cxf/attachment/AttachmentSerializer.java   | 10 ++++++++--
 .../org/apache/cxf/attachment/AttachmentSerializerTest.java    |  5 +++++
 2 files changed, 13 insertions(+), 2 deletions(-)

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 033d33d083..decb2526d1 100644
--- a/core/src/main/java/org/apache/cxf/attachment/AttachmentSerializer.java
+++ b/core/src/main/java/org/apache/cxf/attachment/AttachmentSerializer.java
@@ -26,6 +26,7 @@ import java.io.StringWriter;
 import java.io.Writer;
 import java.net.URLDecoder;
 import java.net.URLEncoder;
+import java.nio.charset.Charset;
 import java.nio.charset.StandardCharsets;
 import java.util.Collections;
 import java.util.Iterator;
@@ -225,8 +226,8 @@ public class AttachmentSerializer {
             // remaining parts with an angle bracket pair, "<" and ">".  
             //
             if (attachmentId.startsWith("cid:")) {
-                writer.write(URLDecoder.decode(attachmentId.substring(4),
-                    StandardCharsets.UTF_8.name()));
+                writer.write(decode(attachmentId.substring(4),
+                    StandardCharsets.UTF_8));
             } else { 
                 //
                 // RFC-2392 (https://datatracker.ietf.org/doc/html/rfc2392) says:
@@ -371,4 +372,9 @@ public class AttachmentSerializer {
         this.xop = xop;
     }
 
+    // URL decoder would also decode '+' but according to  RFC-2392 we need to convert
+    // only the % encoded character to their equivalent US-ASCII characters. 
+    private static String decode(String s, Charset charset) {
+        return URLDecoder.decode(s.replaceAll("([^%])[+]", "$1%2B"), charset);
+    }
 }
diff --git a/core/src/test/java/org/apache/cxf/attachment/AttachmentSerializerTest.java b/core/src/test/java/org/apache/cxf/attachment/AttachmentSerializerTest.java
index 2c6c1cd249..9d7bcd228c 100644
--- a/core/src/test/java/org/apache/cxf/attachment/AttachmentSerializerTest.java
+++ b/core/src/test/java/org/apache/cxf/attachment/AttachmentSerializerTest.java
@@ -187,6 +187,11 @@ public class AttachmentSerializerTest {
     public void testMessageMTOMUrlDecoded() throws Exception {
         doTestMessageMTOM("test+me.xml", "<test%2Bme.xml>");
     }
+    
+    @Test
+    public void testMessageMTOMUrlDecodedCid() throws Exception {
+        doTestMessageMTOM("cid:test+me.xml", "<test+me.xml>");
+    }
 
     private void doTestMessageMTOM(String contentId, String expectedContentId) throws Exception {
         MessageImpl msg = new MessageImpl();


[cxf] 04/04: Fixing compilation issues (post CXF-8698 merge)

Posted by re...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 142c1aa054e9233135e9bdac410ad0abe72bf57a
Author: Andriy Redko <dr...@gmail.com>
AuthorDate: Sun Sep 18 15:38:16 2022 -0400

    Fixing compilation issues (post CXF-8698 merge)
    
    (cherry picked from commit 15f81404a531b9072854c417a5c0720dcbdc4684)
---
 .../main/java/org/apache/cxf/attachment/AttachmentSerializer.java    | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

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 decb2526d1..05e332aafc 100644
--- a/core/src/main/java/org/apache/cxf/attachment/AttachmentSerializer.java
+++ b/core/src/main/java/org/apache/cxf/attachment/AttachmentSerializer.java
@@ -23,6 +23,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.io.StringWriter;
+import java.io.UnsupportedEncodingException;
 import java.io.Writer;
 import java.net.URLDecoder;
 import java.net.URLEncoder;
@@ -374,7 +375,7 @@ public class AttachmentSerializer {
 
     // URL decoder would also decode '+' but according to  RFC-2392 we need to convert
     // only the % encoded character to their equivalent US-ASCII characters. 
-    private static String decode(String s, Charset charset) {
-        return URLDecoder.decode(s.replaceAll("([^%])[+]", "$1%2B"), charset);
+    private static String decode(String s, Charset charset) throws UnsupportedEncodingException {
+        return URLDecoder.decode(s.replaceAll("([^%])[+]", "$1%2B"), charset.name());
     }
 }


[cxf] 03/04: Recording .gitmergeinfo Changes

Posted by re...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit f47c636e1ba443070b450c47f914744c77c7dfb1
Author: Andriy Redko <dr...@gmail.com>
AuthorDate: Sun Sep 18 14:38:29 2022 -0400

    Recording .gitmergeinfo Changes
---
 .gitmergeinfo | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/.gitmergeinfo b/.gitmergeinfo
index 2ff01916e2..64b55d80be 100644
--- a/.gitmergeinfo
+++ b/.gitmergeinfo
@@ -40,6 +40,7 @@ B 2ec061d12343efbc93cd05d65002c8efad8622bd
 B 2f28098031610f0279d93b0d4b8d32559707383d
 B 320534fa741aa00834c1d35a46efd3eedeb7229a
 B 332a02450fe1620daeaa2b65c0716e337d49095a
+B 33e1cd0ca132cf0012b126d71745c114eb0a7325
 B 34a8f691a1926a26d2ecefa527eaf76f68b98def
 B 36c7be2b56de371bf2f9af5c10f322973d3b2a59
 B 3786f439160432c37504c5b816905bee193587ea
@@ -317,6 +318,7 @@ M 66cfed6054c97d461361892efb55d51dd51694d6
 M 675006323cdc3d1f8c8fbe1f65c03f4884782401
 M 67d7e562c786e5cbe0d88f82832622e6f3e7131f
 M 6831a7db212d18956640d9fffb85f9e7c50182ad
+M 68791b9bd765d9d597d0259185efa3ebe80a0fa4
 M 689ec48d044a62627ca302da6b219cb292eee36e
 M 6a23a557ec646e8e80fe3dc231484d237d693e8b
 M 6a77819f4bc141fcddd53a36b178972f1f68fe97


[cxf] 01/04: Update Jetty to 9.4.49.v20220914

Posted by re...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit ccdc4f7d7e0e3283fa8d08c9391787818a335e8a
Author: Andriy Redko <dr...@gmail.com>
AuthorDate: Sun Sep 18 13:48:15 2022 -0400

    Update Jetty to 9.4.49.v20220914
    
    (cherry picked from commit d37010086c7763d4dc6c27b00b5ed4971da25474)
    (cherry picked from commit 68791b9bd765d9d597d0259185efa3ebe80a0fa4)
---
 parent/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/parent/pom.xml b/parent/pom.xml
index 1666ce4174..aa4e782d96 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -155,7 +155,7 @@
         <cxf.jdom.version>1.0</cxf.jdom.version>
         <cxf.jettison.version>1.5.0</cxf.jettison.version>
         <cxf.jetty.osgi.version>[9.2,10)</cxf.jetty.osgi.version>
-        <cxf.jetty9.version>9.4.48.v20220622</cxf.jetty9.version>
+        <cxf.jetty9.version>9.4.49.v20220914</cxf.jetty9.version>
         <cxf.jetty.version>${cxf.jetty9.version}</cxf.jetty.version>
         <cxf.jexl.version>3.1</cxf.jexl.version>
         <cxf.joda.time.version>2.10.10</cxf.joda.time.version>