You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Matt Sicker (JIRA)" <ji...@apache.org> on 2016/02/11 16:42:18 UTC
[jira] [Comment Edited] (CAMEL-9588) Query parameters are not
URL-decoded in rest dsl
[ https://issues.apache.org/jira/browse/CAMEL-9588?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15142891#comment-15142891 ]
Matt Sicker edited comment on CAMEL-9588 at 2/11/16 3:42 PM:
-------------------------------------------------------------
I enabled that option and all it seems to decode are + signs.
My config:
{code}
restConfiguration()
.component("netty4-http")
.componentProperty("urlDecodeHeaders", "true")
.bindingMode(RestBindingMode.json)
.skipBindingOnErrorCode(false)
.dataFormatProperty("prettyPrint", "true")
.contextPath("synergy")
.host(host)
.port(port);
{code}
Then I make a request like q=New%20York and then ${headers.q} will print "New%20York", but if I make a request like q=New+York I get ${headers.q} printed as "New York".
was (Author: jvz):
I enabled that option and all it seems to decode are + signs.
> Query parameters are not URL-decoded in rest dsl
> ------------------------------------------------
>
> Key: CAMEL-9588
> URL: https://issues.apache.org/jira/browse/CAMEL-9588
> Project: Camel
> Issue Type: Bug
> Components: rest
> Affects Versions: 2.16.2
> Environment: Karaf 3.0.4, Java 1.8.0_66, Mac OS X 10.10.5, camel-netty-http4
> Reporter: Matt Sicker
> Assignee: Claus Ibsen
>
> Pretty much what it says in the subject, but here's some sample code:
> {code}
> rest("/").get("search")
> .param()
> .name("q")
> .type(RestParamType.query)
> .endParam()
> .route()
> .to("direct:search")
> .endRest();
> from("direct:search").log("q = ${headers.q}");
> {code}
> Then I do GET /search?q=New%20York and it prints out "q = New%20York" instead of "q = New York". When I use CXF, though, the query parameters are automatically decoded.
> This bug report may also apply to path params and such, but I came across this issue while porting from CXF stubs to the rest dsl.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)