[
https://issues.apache.org/jira/browse/CAMEL-5453?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13416609#comment-13416609
]
Christian Müller commented on CAMEL-5453:
-----------------------------------------
This is a bit tricky here. To send a '+' sign to AWS, we have to encode it to
'%2B', because otherwise the '+' sign is interpreted as ' ' sign.
But because Camel use (quasi / so called) URI's, we have to encode it twice.
This means we have to encode the '+' sign to '%252B'.
Camel should decode it to '%2B' which should be send to AWS.
Line 109 of
[URISupport.java|https://svn.apache.org/repos/asf/camel/trunk/camel-core/src/main/java/org/apache/camel/util/URISupport.java]
prevents this.
running
{code}
git blame camel-core/src/main/java/org/apache/camel/util/URISupport.java
{code}
show that this change was done by Hadrian at 3rd of February:
{code}
04066a8e (Hadrian Zbarcea 2012-02-03 07:14:21 +0000 109)
String value = URLDecoder.decode(parameter.substring(p + 1).replaceAll("%",
"%25"), CHARSET);
{code}
This change belongs to
[CAMEL-4954|https://issues.apache.org/jira/browse/CAMEL-4954]
> An AWS key with "+" gets stripped out by
> DefaultCamelContext.normalizeEndointUri and URISupport.parseQuery for at
> least the SQS Component
> ------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: CAMEL-5453
> URL: https://issues.apache.org/jira/browse/CAMEL-5453
> Project: Camel
> Issue Type: Bug
> Components: camel-aws, camel-core
> Affects Versions: 2.10.0
> Reporter: Jason Whaley
> Assignee: Christian Müller
>
> When defining a camel route that includes an endpoint for the SQS component
> that includes the accessKey and secretKey as parameters, such as the
> following:
> {code}
> aws-sqs://queue-name?accessKey=ABCDEFGHIJKLMNOP&secretKey=ABCDEFGHI+JK
> {code}
> if the secretKey contains a + then that + is stripped out in
> URISupport.parseQuery and the parameters received by
> SqsComponent.createEndpoint has a space where the + used to be in the
> secretKey, thus making calls to SQS by the SqsComponent fail.
> Even if the endpoint URI string is URL encoded such that
> secretKey=ABCDEFGHI%2BJK, then DefaultCamelContext.normalizeEndointUri will
> decode the %2B to a "+" earlier in the call stack before
> URISupport.parseQuery is called (which then removes it).
> A "+" is a valid and common character in generated AWS secret keys and thus
> needs to be left alone when it is placed in the parameter Map<String,Object>
> received in SqsComponent.createEndpoint, or replaced with custom parsing in
> SqsComponent.createEndpoint.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira