Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-7353

Configuring an http4 endpoint with hostname starting with "http" leads to an URISyntaxException

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.11.4, 2.12.3, 2.13.0
    • Fix Version/s: 2.12.4, 2.13.1, 2.14.0
    • Component/s: camel-http4
    • Labels:
      None
    • Patch Info:
      Patch Available
    • Estimated Complexity:
      Unknown

      Description

      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 (around line 211):

              // 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 introduced within CAMEL-6880. I'm not shure why the variable remaining is checked for a protocol prefix as it already comes without one. Setting

              String addressUri == null;
      

      would solve the problem and does not break any test.

        Attachments

        1. CAMEL-7353.patch
          1 kB
          Andreas Würl

          Activity

            People

            • Assignee:
              njiang Willem Jiang
              Reporter:
              wuan Andreas Würl
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: