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 2023/04/18 15:58:45 UTC

[cxf] branch 3.4.x-fixes updated (cae26521bf -> 446259b52d)

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 cae26521bf Update Apache Tomcat to 9.0.74
     new d4ffa6b485 CXF-8833: GZIPInInterceptor, when processing HTTP 204 empty response, throws EOFException
     new 446259b52d Recording .gitmergeinfo Changes

The 2 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                                      |  5 ++
 .../transport/common/gzip/GZIPInInterceptor.java   |  5 ++
 .../cxf/common/gzip/GZIPInInterceptorTest.java     | 62 ++++++++++++++++++++++
 3 files changed, 72 insertions(+)
 create mode 100644 core/src/test/java/org/apache/cxf/common/gzip/GZIPInInterceptorTest.java


[cxf] 02/02: 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 446259b52d0f7743c406ac596013de9df5c32e9c
Author: Andriy Redko <dr...@gmail.com>
AuthorDate: Tue Apr 18 11:58:28 2023 -0400

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

diff --git a/.gitmergeinfo b/.gitmergeinfo
index 3de42703f7..4fc11b6808 100644
--- a/.gitmergeinfo
+++ b/.gitmergeinfo
@@ -93,6 +93,7 @@ B 5086fe53662cfb6ab7c2acc2d0af27358f54da2a
 B 51a69df3c63b394708571ae26ba2e6c6c49b869f
 B 51d72b09425fa7a19eb7b0fdba2a2203ec6e47d3
 B 52b178792508c5ffcf06aed54f6f59ae999e9e8e
+B 52e4d9d82f2ac951da264199a2e50b9e0fe7fd4d
 B 5330712b1160b904d093d8579652e8000e1ba253
 B 54fb5c77077f2e905f04cd536306d43015afc31d
 B 55f1b64fc4c3cadc2448171267fa45c224a58abd
@@ -273,6 +274,7 @@ B f93a0cea91c19c41338d96899a69bb66c463e9ff
 B fab90409cb5ac67b04fe80039870972d758b8349
 B faba2ac4fb90ec96b79c693aa4491622ed2ae010
 B fb02ed59d270bbd78fc6b931bbbaacd1dc0c42ec
+B fb5a6465f1c90353d4ab2be6ff19bdec47c58225
 B fbb800f42004bbf1415b8762d43057ce70b32555
 B fbfb16b5344e415437ad73dc709c51c60755f430
 B fe058a4c83590e7a768e5be32c94622cbe1a3b6b
@@ -359,6 +361,7 @@ M 36d24f1fbbb896105f43121b841a702b8c058fa3
 M 370f0926a5c3b092f987438109ab39db9fcae0a8
 M 37ce0562e8b98bf8fce0c15834a45ff9b5eb58e6
 M 38d899f2891381d287b4782bd4211d6301f3b4c1
+M 39b3a4d4a996307db7a1228a2ec0ff5ca8e0e7b7
 M 39ff641f3d81d8e0b9487ae8c49ac2a5bf055bc1
 M 3aeca347799280dd33e784599a6206efd662924c
 M 3b880c0f73b335adaff5abfa81993a0e4d8d7a10
@@ -498,6 +501,7 @@ M 859fc2e6f486157b34530a8dfe037b40d42559c3
 M 866c6b91e3690672b2955ee190bff317fb75084b
 M 87f970b5d2d4bfacdd01a3f93a70a5020020dc51
 M 88907f141ee80792627da3cc7846d1562f6c0238
+M 8a1fab18e32e243e0db88443f0d636947edd5367
 M 8ae6440a00f066652c37e6f1d122b52c5a6c7b49
 M 8b3d74cb9bdf0be862f3180ff2f101fb3d9c888b
 M 8b637ce74eedf88a40d3821de485ff2fab39bafd
@@ -552,6 +556,7 @@ M a842ad9451c3b6dcc621bdb758231819e84e4cb4
 M a85cfb923ce2cf72c944d8ce774de273c947ff78
 M a894689ac803c234bf38a59f7d845aec4f4d70e0
 M a89cf6fbab8028ea343c6d47bb68400d123375af
+M a9bcd8b7f0d1d1090e2e2a4008e465b35196ae58
 M a9d29a7f2b40563f5cf74337009ae51a6a514d93
 M ab533d05f066a89af2a33787eb2cc615679ec72c
 M ab7d11812307d557c759180d3efdca61f51225b6


[cxf] 01/02: CXF-8833: GZIPInInterceptor, when processing HTTP 204 empty response, throws EOFException

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 d4ffa6b485dd793671f601de474684e7f96cc67f
Author: Andriy Redko <dr...@gmail.com>
AuthorDate: Sat Apr 15 12:34:47 2023 -0400

    CXF-8833: GZIPInInterceptor, when processing HTTP 204 empty response, throws EOFException
    
    (cherry picked from commit a0c73466dd660997ce2d98107dc74554147fb85a)
    (cherry picked from commit d26158d2cf03b72bb25636aa25691962b18d42bc)
---
 .../transport/common/gzip/GZIPInInterceptor.java   |  5 ++
 .../cxf/common/gzip/GZIPInInterceptorTest.java     | 62 ++++++++++++++++++++++
 2 files changed, 67 insertions(+)

diff --git a/core/src/main/java/org/apache/cxf/transport/common/gzip/GZIPInInterceptor.java b/core/src/main/java/org/apache/cxf/transport/common/gzip/GZIPInInterceptor.java
index 6ddf69718d..b2505a3bfc 100644
--- a/core/src/main/java/org/apache/cxf/transport/common/gzip/GZIPInInterceptor.java
+++ b/core/src/main/java/org/apache/cxf/transport/common/gzip/GZIPInInterceptor.java
@@ -82,6 +82,11 @@ public class GZIPInInterceptor extends AbstractPhaseInterceptor<Message> {
                         return;
                     }
 
+                    final Integer responseCode = (Integer)message.get(Message.RESPONSE_CODE);
+                    if (responseCode != null && responseCode == 204) {
+                        return;
+                    }
+
                     // wrap an unzipping stream around the original one
                     GZIPInputStream zipInput = new GZIPInputStream(is);
                     message.setContent(InputStream.class, zipInput);
diff --git a/core/src/test/java/org/apache/cxf/common/gzip/GZIPInInterceptorTest.java b/core/src/test/java/org/apache/cxf/common/gzip/GZIPInInterceptorTest.java
new file mode 100644
index 0000000000..1e00d1f09a
--- /dev/null
+++ b/core/src/test/java/org/apache/cxf/common/gzip/GZIPInInterceptorTest.java
@@ -0,0 +1,62 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.common.gzip;
+
+import java.io.InputStream;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+
+import org.apache.cxf.helpers.HttpHeaderHelper;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.message.MessageImpl;
+import org.apache.cxf.transport.common.gzip.GZIPInInterceptor;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.junit.Assert.assertThat;
+
+public class GZIPInInterceptorTest {
+    private Message message;
+    
+    @Before
+    public void setUp() {
+        final Map<String, List<String>> heeaders = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
+        heeaders.put(HttpHeaderHelper.CONTENT_ENCODING, Collections.singletonList("gzip"));
+
+        message = new MessageImpl();
+        message.put(Message.PROTOCOL_HEADERS, heeaders);
+    }
+
+    @Test
+    public void testNoContent() {
+        final GZIPInInterceptor interceptor = new GZIPInInterceptor();
+        final InputStream nullInputStream = InputStream.nullInputStream();
+
+        message.setContent(InputStream.class, nullInputStream);
+        message.put(Message.RESPONSE_CODE, 204);
+
+        interceptor.handleMessage(message);
+        assertThat(message.getContent(InputStream.class), equalTo(nullInputStream));
+    }
+}