You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ff...@apache.org on 2018/11/06 03:26:50 UTC

[camel] branch camel-2.22.x updated: [CAMEL-12911]gzip Content-Encoding problems after upgrading to Jetty 9.4.12

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

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


The following commit(s) were added to refs/heads/camel-2.22.x by this push:
     new dff9137  [CAMEL-12911]gzip Content-Encoding problems after upgrading to Jetty 9.4.12
dff9137 is described below

commit dff913741216e22c3cf930f2beeb9750c2ea462d
Author: Freeman Fang <fr...@gmail.com>
AuthorDate: Mon Nov 5 20:41:45 2018 +0800

    [CAMEL-12911]gzip Content-Encoding problems after upgrading to Jetty 9.4.12
    
    (cherry picked from commit e0aba10ab4b792f21619e82a41e680b7cddc80ec)
    
    Conflicts:
    	parent/pom.xml
---
 .../org/apache/camel/component/jetty9/AttachmentHttpBinding.java   | 7 +++++++
 parent/pom.xml                                                     | 3 +--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/components/camel-jetty9/src/main/java/org/apache/camel/component/jetty9/AttachmentHttpBinding.java b/components/camel-jetty9/src/main/java/org/apache/camel/component/jetty9/AttachmentHttpBinding.java
index 7c51839..b72f0c6 100644
--- a/components/camel-jetty9/src/main/java/org/apache/camel/component/jetty9/AttachmentHttpBinding.java
+++ b/components/camel-jetty9/src/main/java/org/apache/camel/component/jetty9/AttachmentHttpBinding.java
@@ -29,6 +29,7 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.Part;
 
 import org.apache.camel.Attachment;
+import org.apache.camel.Exchange;
 import org.apache.camel.RuntimeCamelException;
 import org.apache.camel.http.common.DefaultHttpBinding;
 import org.apache.camel.http.common.HttpHelper;
@@ -76,6 +77,12 @@ final class AttachmentHttpBinding extends DefaultHttpBinding {
     protected void populateRequestParameters(HttpServletRequest request, HttpMessage message) throws Exception {
         //we populate the http request parameters without checking the request method
         Map<String, Object> headers = message.getHeaders();
+        //remove Content-Encoding from request
+        if (request instanceof org.eclipse.jetty.server.Request) {
+            org.eclipse.jetty.server.Request jettyRequest = (org.eclipse.jetty.server.Request)request;
+            jettyRequest.getHttpFields().remove(Exchange.CONTENT_ENCODING);
+        }
+        
         Enumeration<?> names = request.getParameterNames();
         while (names.hasMoreElements()) {
             String name = (String)names.nextElement();
diff --git a/parent/pom.xml b/parent/pom.xml
index c0d659e..b6c0ac7 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -383,8 +383,7 @@
     <jersey-version>2.11</jersey-version>
     <jetty6-bundle-version>6.1.26_4</jetty6-bundle-version>
     <jetty92-version>9.2.22.v20170606</jetty92-version>
-    <!-- Jetty 9.4.7 is buggy, do not use -->
-    <jetty9-version>9.4.6.v20170531</jetty9-version>
+    <jetty9-version>9.4.12.v20180830</jetty9-version>
     <jetty-version>${jetty9-version}</jetty-version>
     <jetty-plugin-version>${jetty-version}</jetty-plugin-version>
     <jetty-runner-groupId>org.eclipse.jetty</jetty-runner-groupId>