Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id C1701200C2B for ; Wed, 15 Feb 2017 11:28:56 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id C04A5160B46; Wed, 15 Feb 2017 10:28:56 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 169ED160B5E for ; Wed, 15 Feb 2017 11:28:55 +0100 (CET) Received: (qmail 68485 invoked by uid 500); 15 Feb 2017 10:28:55 -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 68390 invoked by uid 99); 15 Feb 2017 10:28:55 -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; Wed, 15 Feb 2017 10:28:55 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 1E293DFD9E; Wed, 15 Feb 2017 10:28:55 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: davsclaus@apache.org To: commits@camel.apache.org Date: Wed, 15 Feb 2017 10:28:56 -0000 Message-Id: <222657b89f3940cd830504c1119dcbb8@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [2/2] camel git commit: CAMEL-10813: Host address in the rest configuration is now taken care of when creating a Restlet Server archived-at: Wed, 15 Feb 2017 10:28:56 -0000 CAMEL-10813: Host address in the rest configuration is now taken care of when creating a Restlet Server Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/f376a01c Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/f376a01c Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/f376a01c Branch: refs/heads/camel-2.18.x Commit: f376a01c8e231449fed3de2156d63ced64297b4c Parents: 6ea18cb Author: admin Authored: Wed Feb 15 15:37:20 2017 +0530 Committer: Claus Ibsen Committed: Wed Feb 15 11:28:50 2017 +0100 ---------------------------------------------------------------------- .../org/apache/camel/component/restlet/RestletComponent.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/f376a01c/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/RestletComponent.java ---------------------------------------------------------------------- diff --git a/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/RestletComponent.java b/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/RestletComponent.java index fdbca18..2ab533c 100644 --- a/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/RestletComponent.java +++ b/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/RestletComponent.java @@ -259,9 +259,15 @@ public class RestletComponent extends HeaderFilterStrategyComponent implements R } protected Server createServer(RestletEndpoint endpoint) { - return new Server(component.getContext().createChildContext(), Protocol.valueOf(endpoint.getProtocol()), endpoint.getPort()); + // Consider hostname if provided. This is useful when loopback interface is required for security reasons. + if (endpoint.getHost() != null) { + return new Server(component.getContext().createChildContext(), Protocol.valueOf(endpoint.getProtocol()), endpoint.getHost(), endpoint.getPort(), null); + } else { + return new Server(component.getContext().createChildContext(), Protocol.valueOf(endpoint.getProtocol()), endpoint.getPort()); + } } + protected String stringArrayToString(String[] strings) { StringBuffer result = new StringBuffer(); for (String str : strings) {