You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Willem Jiang (JIRA)" <ji...@apache.org> on 2015/04/02 08:33:52 UTC

[jira] [Resolved] (CAMEL-8589) url.getPort returning -1, needs additional check

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

Willem Jiang resolved CAMEL-8589.
---------------------------------
       Resolution: Fixed
    Fix Version/s: 2.16.0
                   2.15.2

Applied the patch into camel master and camel-2.15.x branches with thanks to Matthew.

> url.getPort returning -1, needs additional check
> ------------------------------------------------
>
>                 Key: CAMEL-8589
>                 URL: https://issues.apache.org/jira/browse/CAMEL-8589
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-swagger
>    Affects Versions: 2.15.0
>            Reporter: Matthew Casperson
>            Assignee: Willem Jiang
>            Priority: Minor
>             Fix For: 2.15.2, 2.16.0
>
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)