[
https://issues.apache.org/jira/browse/CAMEL-11658?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16473416#comment-16473416
]
ASF GitHub Bot commented on CAMEL-11658:
----------------------------------------
koscejev commented on issue #1938: CAMEL-11658: test for RestletProducer
handling unencoded headers
URL: https://github.com/apache/camel/pull/1938#issuecomment-388612844
This is how it worked before some recent changes in 2.19.0:
1. Header was added to URL
2. Restlet encoded the full URL, so that it's valid
3. Full URL is used
Now, nothing was actually changed in these 3 steps, so it essentially works
the same, BUT there's a new side-effect step that tries to construct URL
manually without encoding and without getting the URL that Restlet is
*actually* using. This step fails whenever URL contains invalid characters
(that Restlet was and still is handling) due to headers.
In my opinion this is a regression and a regrettable one. It's not even a
change in behavior, whether wanted or not, it's just broken.
However, it also highlights another issue with these headers, such as being
able to break other functionality (like providing HTTP_QUERY header) by using
certain headers. Not only it's not documented, but it's extremely
counter-intuitive. E.g., according to documentation you can use HTTP_QUERY
header to provide the query params, but if a header used in your path param
contains `?` character, then this functionality will not work and other
documented stuff will just break in unexpected ways.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> URISyntaxException in RestletProducer
> -------------------------------------
>
> Key: CAMEL-11658
> URL: https://issues.apache.org/jira/browse/CAMEL-11658
> Project: Camel
> Issue Type: Bug
> Components: camel-restlet
> Affects Versions: 2.19.0
> Reporter: Anton Koscejev
> Priority: Minor
>
> CAMEL-10392 introduced session/cookie handling for camel-restlet. However,
> this also introduced a bug where new URI is created from resourceUri before
> it's encoded.
> Before this change the uri would be safely encoded within restlet's Request
> constructor.
> See this code in RestletProducer:
> {code}
> String resourceUri = buildUri(endpoint, exchange);
> URI uri = new URI(resourceUri); // <- causes exception on
> unencoded uri
> request = new Request(endpoint.getRestletMethod(), resourceUri);
> // <- will encode uri
> binding.populateRestletRequestFromExchange(request, exchange);
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)