[ 
https://issues.apache.org/jira/browse/CAMEL-12245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16358545#comment-16358545
 ] 

ASF GitHub Bot commented on CAMEL-12245:
----------------------------------------

transamericamoon closed pull request #2213: CAMEL-12245 Bridged http servlet 
endpoints should not populate reques…
URL: https://github.com/apache/camel/pull/2213
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/components/camel-http-common/src/main/java/org/apache/camel/http/common/DefaultHttpBinding.java
 
b/components/camel-http-common/src/main/java/org/apache/camel/http/common/DefaultHttpBinding.java
index 4bf1b76c2dd..9bb64f2e6e4 100644
--- 
a/components/camel-http-common/src/main/java/org/apache/camel/http/common/DefaultHttpBinding.java
+++ 
b/components/camel-http-common/src/main/java/org/apache/camel/http/common/DefaultHttpBinding.java
@@ -171,7 +171,15 @@ protected void readHeaders(HttpServletRequest request, 
HttpMessage message) {
         }
 
         try {
-            populateRequestParameters(request, message);
+            // only populate request parameters if we are not bridged
+            boolean bridged = false;
+            Endpoint endpoint = message.getExchange().getFromEndpoint();
+            if (endpoint instanceof HttpCommonEndpoint && 
((HttpCommonEndpoint)endpoint).isBridgeEndpoint()) {
+                bridged = true;
+            } 
+            if (!bridged) {
+                populateRequestParameters(request, message);
+            }
         } catch (Exception e) {
             throw new RuntimeCamelException("Cannot read request parameters 
due " + e.getMessage(), e);
         }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Bridged http servlet endpoints should not populate request parameters into 
> exchange headers
> -------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-12245
>                 URL: https://issues.apache.org/jira/browse/CAMEL-12245
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-http-common
>    Affects Versions: 2.20.2
>            Reporter: john
>            Priority: Major
>
> When you create a servlet endpoint and use the bridgeEndpoint option, the 
> queryParameters should NOT be put into the exchange headers, because when you 
> pass this on to the next  (http4) endpoint you have the query parameters and 
> the same parameters as http headers.  So now you are sending additional 
> headers instead of bridging.
>  
> example
>  
> {code:java}
> from("servlet:?matchOnUriPrefix=true&bridgeEndpoint=true")
>   .to("http4://localhost:8080/testService);
> {code}
>  
>                    
> You can work around this by creating a custom httpBinding, but you should not 
> have to do this when the connection is bridged.
> WIll submit PR.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to