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/05 12:43:50 UTC

[camel] branch master 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 master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
     new e0aba10  [CAMEL-12911]gzip Content-Encoding problems after upgrading to Jetty 9.4.12
     new db8a577  Merge branch 'master' of github.com:apache/camel
e0aba10 is described below

commit e0aba10ab4b792f21619e82a41e680b7cddc80ec
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
---
 components/camel-jetty9/src/main/docs/jetty-component.adoc         | 2 +-
 .../org/apache/camel/component/jetty9/AttachmentHttpBinding.java   | 7 +++++++
 parent/pom.xml                                                     | 2 +-
 3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/components/camel-jetty9/src/main/docs/jetty-component.adoc b/components/camel-jetty9/src/main/docs/jetty-component.adoc
index 0c313f7..42f5833 100644
--- a/components/camel-jetty9/src/main/docs/jetty-component.adoc
+++ b/components/camel-jetty9/src/main/docs/jetty-component.adoc
@@ -148,7 +148,7 @@ with the following path and query parameters:
 | *sessionSupport* (consumer) | Specifies whether to enable the session manager on the server side of Jetty. | false | boolean
 | *useContinuation* (consumer) | Whether or not to use Jetty continuations for the Jetty Server. |  | Boolean
 | *eagerCheckContentAvailable* (consumer) | Whether to eager check whether the HTTP requests has content if the content-length header is 0 or not present. This can be turned on in case HTTP clients do not send streamed data. | false | boolean
-| *exceptionHandler* (consumer) | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored. |  | ExceptionHandler
+| *exceptionHandler* (consumer) | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored. |  | ExceptionHandler
 | *exchangePattern* (consumer) | Sets the exchange pattern when the consumer creates an exchange. |  | ExchangePattern
 | *filterInitParameters* (consumer) | Configuration of the filter init parameters. These parameters will be applied to the filter list before starting the jetty server. |  | Map
 | *filtersRef* (consumer) | Allows using a custom filters which is putted into a list and can be find in the Registry. Multiple values can be separated by comma. |  | String
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 92e4627..bac9fea 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -382,7 +382,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>
-    <jetty9-version>9.4.11.v20180605</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>