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

url.getPort returning -1, needs additional check

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.15.0
    • Fix Version/s: 2.15.2, 2.16.0
    • Component/s: camel-swagger
    • Labels:
      None

      Description

      In our environment, the camel-swagger component is building relative urls with a port of -1. http://docs.oracle.com/javase/7/docs/api/java/net/URL.html#getPort() is what is returning -1.

      The fix is to change

      if (url.getPort != 80) {

      to

      if (url.getPort != 80 && url.getPort != -1) {

      in RestSwaggerApiDeclarationServlet.scala. See https://github.com/apache/camel/blob/camel-2.15.x/components/camel-swagger/src/main/scala/org/apache/camel/component/swagger/RestSwaggerApiDeclarationServlet.scala#L111 for the line of code that is affected.

        Attachments

          Activity

            People

            • Assignee:
              njiang Willem Jiang
              Reporter:
              mcasperson Matthew Casperson
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: