From bd56b0a79efe4820469ea907f620da0be207d4c6 Mon Sep 17 00:00:00 2001 From: Simon Willnauer Date: Wed, 19 Aug 2015 14:54:56 +0200 Subject: [PATCH] Only resolve host if explicitly allowed. We have some settings that prevent host name resolution which should be repected by InetSocketTransportAddress#getHost() to only resolve if allowed or desired. --- .../common/transport/InetSocketTransportAddress.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/elasticsearch/common/transport/InetSocketTransportAddress.java b/core/src/main/java/org/elasticsearch/common/transport/InetSocketTransportAddress.java index f4f686ff2e5..07db52b4fbe 100644 --- a/core/src/main/java/org/elasticsearch/common/transport/InetSocketTransportAddress.java +++ b/core/src/main/java/org/elasticsearch/common/transport/InetSocketTransportAddress.java @@ -94,7 +94,11 @@ public final class InetSocketTransportAddress implements TransportAddress { @Override public String getHost() { - return address.getHostName(); + if (resolveAddress) { + return address.getHostName(); + } else { + return getAddress(); + } } @Override