camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zoran Regvart (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (CAMEL-10917) Implementations of RestProducerFactory should handle empty or null basePath and uriTemplate
Date Wed, 01 Mar 2017 17:27:45 GMT

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

Zoran Regvart resolved CAMEL-10917.
-----------------------------------
       Resolution: Fixed
    Fix Version/s: 2.19.0

> Implementations of RestProducerFactory should handle empty or null basePath and uriTemplate
> -------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-10917
>                 URL: https://issues.apache.org/jira/browse/CAMEL-10917
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core, camel-http, camel-http4, camel-jetty, camel-netty4-http,
camel-restlet, camel-undertow
>    Affects Versions: 2.19.0
>            Reporter: Zoran Regvart
>            Assignee: Zoran Regvart
>            Priority: Minor
>             Fix For: 2.19.0
>
>
> All RestProducerFactory implementations use code similar to:
> {code:java}
> String url;
> if (uriTemplate != null) {
>     // http is already prefixed in base path
>     url = String.format("%s/%s/%s", host, basePath, uriTemplate);
> } else {
>     // http is already prefixed in base path
>     url = String.format("%s/%s", host, basePath);
> }
> {code}
> This fails to account for {{basePath}} being null or empty, and {{uriTemplate}} being
empty, which results in the resulting {{url}} to either have double slashes (e.g. {{http://host//uriTemplate}})
or {{"null"}} {{String}} in {{url}} (e.g. {{http://host/null/uriTemplate}}).



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message