[
https://issues.apache.org/jira/browse/CAMEL-7353?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Andreas Würl updated CAMEL-7353:
--------------------------------
Description:
Trying to configure an endpoint like
{code}
http4://http.org
{code}
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
(around line 211):
{code}
// need to set scheme on address uri depending on if its secure or not
String addressUri = remaining.startsWith("http") ? remaining : null;
{code}
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 the
variable {{remaining}} is checked for a protocol prefix as it already comes
without one. Setting
{code}
String addressUri == null;
{code}
helps to solve the problem and does not break any test.
was:
Trying to configure an endpoint like
{code}
http4://http.org
{code}
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
(around line 211):
{code}
// need to set scheme on address uri depending on if its secure or not
String addressUri = remaining.startsWith("http") ? remaining : null;
{code}
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
{code}
String addressUri == null;
{code}
helps to solve the problem and does not break any test.
> 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.11.4, 2.12.3, 2.13.0
> Reporter: Andreas Würl
>
> Trying to configure an endpoint like
> {code}
> http4://http.org
> {code}
> 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 (around line 211):
> {code}
> // need to set scheme on address uri depending on if its secure or not
> String addressUri = remaining.startsWith("http") ? remaining : null;
> {code}
> 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 the
> variable {{remaining}} is checked for a protocol prefix as it already comes
> without one. Setting
> {code}
> String addressUri == null;
> {code}
> helps to solve the problem and does not break any test.
--
This message was sent by Atlassian JIRA
(v6.2#6252)