Return-Path: X-Original-To: apmail-camel-commits-archive@www.apache.org Delivered-To: apmail-camel-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 38DD6175EF for ; Thu, 2 Apr 2015 03:16:21 +0000 (UTC) Received: (qmail 39374 invoked by uid 500); 2 Apr 2015 03:16:21 -0000 Delivered-To: apmail-camel-commits-archive@camel.apache.org Received: (qmail 39328 invoked by uid 500); 2 Apr 2015 03:16:21 -0000 Mailing-List: contact commits-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list commits@camel.apache.org Received: (qmail 39266 invoked by uid 99); 2 Apr 2015 03:16:20 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Apr 2015 03:16:20 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 9DDECE2F20; Thu, 2 Apr 2015 03:16:20 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ningjiang@apache.org To: commits@camel.apache.org Message-Id: <9ffab39698444e239edbc4b86292b2d8@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: camel git commit: CAMEL-8589 Fixed the url.getPort returning -1 issue of camel-swagger with thanks to Matthew. Date: Thu, 2 Apr 2015 03:16:20 +0000 (UTC) Repository: camel Updated Branches: refs/heads/master b3ebc297f -> 3f4a2f9e7 CAMEL-8589 Fixed the url.getPort returning -1 issue of camel-swagger with thanks to Matthew. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/3f4a2f9e Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/3f4a2f9e Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/3f4a2f9e Branch: refs/heads/master Commit: 3f4a2f9e7f8d7ff296a879bd4bf872aa3bec9af3 Parents: b3ebc29 Author: Willem Jiang Authored: Thu Apr 2 10:55:49 2015 +0800 Committer: Willem Jiang Committed: Thu Apr 2 10:57:23 2015 +0800 ---------------------------------------------------------------------- .../component/swagger/RestSwaggerApiDeclarationServlet.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/3f4a2f9e/components/camel-swagger/src/main/scala/org/apache/camel/component/swagger/RestSwaggerApiDeclarationServlet.scala ---------------------------------------------------------------------- diff --git a/components/camel-swagger/src/main/scala/org/apache/camel/component/swagger/RestSwaggerApiDeclarationServlet.scala b/components/camel-swagger/src/main/scala/org/apache/camel/component/swagger/RestSwaggerApiDeclarationServlet.scala index 9057863..038f18f 100644 --- a/components/camel-swagger/src/main/scala/org/apache/camel/component/swagger/RestSwaggerApiDeclarationServlet.scala +++ b/components/camel-swagger/src/main/scala/org/apache/camel/component/swagger/RestSwaggerApiDeclarationServlet.scala @@ -108,7 +108,7 @@ abstract class RestSwaggerApiDeclarationServlet extends HttpServlet { base = "" } val path = translateContextPath(request) - if (url.getPort != 80) { + if (url.getPort != 80 && url.getPort != -1) { base = url.getProtocol + "://" + url.getHost + ":" + url.getPort + path + "/" + base } else { base = url.getProtocol + "://" + url.getHost + request.getContextPath + "/" + base @@ -123,7 +123,7 @@ abstract class RestSwaggerApiDeclarationServlet extends HttpServlet { base = "" } val path = translateContextPath(request) - if (url.getPort != 80) { + if (url.getPort != 80 && url.getPort != -1) { base = url.getProtocol + "://" + url.getHost + ":" + url.getPort + path + "/" + base } else { base = url.getProtocol + "://" + url.getHost + request.getContextPath + "/" + base