You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Andreas Würl (JIRA)" <ji...@apache.org> on 2014/04/08 23:14:15 UTC

[jira] [Created] (CAMEL-7353) Configuring an endpoint with a hostname starting with "http" leads to an URISyntaxException

Andreas Würl created CAMEL-7353:
-----------------------------------

             Summary: Configuring an endpoint with a hostname starting with "http" leads to an URISyntaxException
                 Key: CAMEL-7353
                 URL: https://issues.apache.org/jira/browse/CAMEL-7353
             Project: Camel
          Issue Type: Bug
          Components: camel-http4
    Affects Versions: 2.13.0, 2.12.3, 2.11.4
            Reporter: Andreas Würl


Trying to configure an endpoint like
```
http4://http.org
```
where the hostname starts with the characters "http" leads to an URISyntaxException "Expected scheme-specific part at index http4:"

This behaviour is caused by the following lines in camel-http4's HttpComponent:
```
        // need to set scheme on address uri depending on if its secure or not
        String addressUri = remaining.startsWith("http") ? remaining : null;
```
In our case, the hostname is not prefixed with http:// or https:// which leads to the mentioned exception.

The code in question was introduce with CAMEL-6880. I'm not shure why remaining is checked for a protocol prefix as it already comes without. Setting
```
      String addressUri == null;
```
helps to solve the problem and does not break any test. 



--
This message was sent by Atlassian JIRA
(v6.2#6252)