camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CAMEL-9442) Query string gets decoded when bridging from netty-http to http4
Date Wed, 24 Feb 2016 07:03:18 GMT

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

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

GitHub user tadayosi opened a pull request:

    https://github.com/apache/camel/pull/861

    CAMEL-9442 - Add tests for camel-http, porting from camel-http4

    [CAMEL-9442](https://issues.apache.org/jira/browse/CAMEL-9442) should also fix `camel-http`,
so I added the tests for `camel-http` to make sure it really has fixed the issue at `camel-http`
as well.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/tadayosi/camel CAMEL-9442

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/camel/pull/861.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #861
    
----
commit c7fd695e7089130c197f65b7ec1f57eb08530436
Author: Tadayoshi Sato <sato.tadayoshi@gmail.com>
Date:   2016-02-24T06:56:16Z

    CAMEL-9442 - Add tests for camel-http, porting from camel-http4

----


> Query string gets decoded when bridging from netty-http to http4
> ----------------------------------------------------------------
>
>                 Key: CAMEL-9442
>                 URL: https://issues.apache.org/jira/browse/CAMEL-9442
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-http-common, camel-http4
>    Affects Versions: 2.17.0
>            Reporter: Gert Vanthienen
>            Assignee: Gert Vanthienen
>             Fix For: 2.15.6, 2.16.2, 2.17.0
>
>
> When using a route like this one (to forward an HTTP request to a downstream server)
using the {{netty-http}} component, the query is decoded when sent to the downstream server:
> {noformat}
>   from("netty-http:http://localhost:9000/service?matchOnUriPrefix=true")
>           .to ("http4://downstream:9000/service?bridgeEndpoint=true");
> {noformat}
> A request to {{http://localhost:9000/service?q=%3B}} will result in a call to {{http://downstream:9000/service?q=;}}
(notice the decoded {{;}} character). Replacing the {{netty-http:http:}} endpoint with a {{jetty:http:}}
endpoint fixes the problem.
> The difference is in the use of the {{Exchange.HTTP_QUERY}} and {{Exchange.HTTP_RAW_QUERY}}
headers. The {{jetty:http:}} endpoint is only setting the former header (containing the raw
header value), while the {{netty-http:http:}} endpoint is using both headers.
> When using {{bridgeEndpoint}}, the {{http4}} component should prefer the raw query header
over the decoded header if both headers are available.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message