camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snurmine <...@git.apache.org>
Subject [GitHub] camel pull request: CAMEL-8578 - May double encode uri when using ...
Date Fri, 10 Jul 2015 20:20:23 GMT
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 <snurmine@gmail.com>
Date:   2015-07-10T20:04:51Z

    CAMEL-8578 - May double encode uri when using HTTP_URI or HTTP_QUERY headers

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message