camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (CAMEL-9651) Restlet consumer request fails if there is a space '%20' in the url
Date Mon, 23 May 2016 07:02:13 GMT

     [ https://issues.apache.org/jira/browse/CAMEL-9651?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Claus Ibsen resolved CAMEL-9651.
--------------------------------
       Resolution: Fixed
         Assignee: Claus Ibsen
    Fix Version/s: 2.18.0

Thanks for the PR

> Restlet consumer request fails if there is a space '%20' in the url
> -------------------------------------------------------------------
>
>                 Key: CAMEL-9651
>                 URL: https://issues.apache.org/jira/browse/CAMEL-9651
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-restlet
>    Affects Versions: 2.16.2
>            Reporter: Jay mann
>            Assignee: Claus Ibsen
>             Fix For: 2.18.0
>
>         Attachments: patch.txt
>
>
> Consuming a restful service using restlet component fails with URISyntaxException if
there is a special character or space in the URL.  
> To fix this org.apache.camel.component.restlet.RestletComponent should:
> {code}
> @Override
>     public boolean useRawUri() {
>         // should use encoded uri by default
>         return true;
>     }
> {code}
> Simple example of failure:
> {code}
>  rest("/Utils")
> 	    	.description("Camel Utilities Rest Service")
> 	    	.consumes("application/json").produces("application/json")
> 	    	.get("test/testme").route().log("Got HEre").
>                 to("restlet:http://localhost:8299/Utils/test2/TEST%20Name?throwExceptionOnFailure=false&restletMethod=GET")
>                 .getRestDefinition()
>             .get("test2/{name2}").route().log("GOt ${header.name2}");
> {code}
> If you remove the space it works fine.
> {code}
> Caused by: java.net.URISyntaxException: Illegal character in path at index 38: http://localhost:8299/Utils/test2/TEST
Name
> 	at java.net.URI$Parser.fail(URI.java:2848)
> 	at java.net.URI$Parser.checkChars(URI.java:3021)
> 	at java.net.URI$Parser.parseHierarchical(URI.java:3105)
> 	at java.net.URI$Parser.parse(URI.java:3053)
> 	at java.net.URI.<init>(URI.java:588)
> 	at org.apache.camel.component.restlet.RestletComponent.createEndpoint(RestletComponent.java:120)
> 	at org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:114)
> 	at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:570)
> {code}
> It seems like there are lots of bugs with restlet component, What is the most mature
service for consuming restful/http services?
> Thanks.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message