You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2015/07/10 22:21:04 UTC
[jira] [Commented] (CAMEL-8578) camel-http - May double encode uri
when using HTTP_URI or HTTP_QUERY headers
[ https://issues.apache.org/jira/browse/CAMEL-8578?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14622849#comment-14622849 ]
ASF GitHub Bot commented on CAMEL-8578:
---------------------------------------
GitHub user snurmine opened a pull request:
https://github.com/apache/camel/pull/559
CAMEL-8578 - May double encode uri when using HTTP_URI or HTTP_QUERY …
Fix for issue https://issues.apache.org/jira/browse/CAMEL-8578.
camel-http uses class UnsafeUriCharactersEncoder in HttpHelper#createURI.
UnsafeUriCharactersEncoder explicitly doesn't encode character >= 128.
If url = "http://www.google.com/search?hl=en&q=%E2%82%AC" is
as parameter for HttpHelper#createURI, then:
$URI uri = new URI(url);
Here uri now contains queryString in unencoded form,
which means, that also euro-character is in encoded form.
http://www.fileformat.info/info/unicode/char/20aC/index.htm.
Later in same method
$// need to encode query string
$queryString = UnsafeUriCharactersEncoder.encodeHttpURI(queryString);
Method UnsafeUriCharactersEncoder#encodeHttpURI does not
encode euro character back to encoded form.
Fix was to add UTF-8 encoding support into UnsafeUriCharactersEncoder#encodeHttpURI
according to https://tools.ietf.org/html/rfc3986.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/snurmine/camel CAMEL-8578
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/camel/pull/559.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 #559
----
commit 7f186ddabf6808968c730eab03247352ef686b07
Author: Sami Nurminen <sn...@gmail.com>
Date: 2015-07-10T20:04:51Z
CAMEL-8578 - May double encode uri when using HTTP_URI or HTTP_QUERY headers
----
> camel-http - May double encode uri when using HTTP_URI or HTTP_QUERY headers
> ----------------------------------------------------------------------------
>
> Key: CAMEL-8578
> URL: https://issues.apache.org/jira/browse/CAMEL-8578
> Project: Camel
> Issue Type: Bug
> Components: camel-http
> Affects Versions: 2.14.1
> Reporter: Claus Ibsen
> Fix For: Future
>
>
> See nabble
> http://camel.465427.n5.nabble.com/Apache-Camel-decodes-HTTP-query-params-and-httpclient-fails-with-Invalid-query-exception-tp5764794p5764843.html
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)