diff --git a/ml-algorithms/src/main/java/org/opensearch/ml/engine/httpclient/MLHttpClientFactory.java b/ml-algorithms/src/main/java/org/opensearch/ml/engine/httpclient/MLHttpClientFactory.java index 782bd9501e..a31e36ee01 100644 --- a/ml-algorithms/src/main/java/org/opensearch/ml/engine/httpclient/MLHttpClientFactory.java +++ b/ml-algorithms/src/main/java/org/opensearch/ml/engine/httpclient/MLHttpClientFactory.java @@ -57,10 +57,6 @@ public boolean isRedirected(HttpRequest request, HttpResponse response, HttpCont @VisibleForTesting protected static void validateSchemaAndPort(HttpHost host) { - if (Strings.isBlank(host.getHostName())) { - log.error("Remote inference host name is empty!"); - throw new IllegalArgumentException("Host name is empty!"); - } String scheme = host.getSchemeName(); if ("http".equalsIgnoreCase(scheme) || "https".equalsIgnoreCase(scheme)) { String[] hostNamePort = host.getHostName().split(":"); diff --git a/ml-algorithms/src/test/java/org/opensearch/ml/engine/httpclient/MLHttpClientFactoryTests.java b/ml-algorithms/src/test/java/org/opensearch/ml/engine/httpclient/MLHttpClientFactoryTests.java index 4fbf9888fd..d133172881 100644 --- a/ml-algorithms/src/test/java/org/opensearch/ml/engine/httpclient/MLHttpClientFactoryTests.java +++ b/ml-algorithms/src/test/java/org/opensearch/ml/engine/httpclient/MLHttpClientFactoryTests.java @@ -102,5 +102,4 @@ public void test_validateSchemaAndPort_portNotInRange_throwException() { HttpHost httpHost = new HttpHost("api.openai.com:65537", -1, "https"); MLHttpClientFactory.validateSchemaAndPort(httpHost); } - }