diff --git a/java/hsfs/src/main/java/com/logicalclocks/hsfs/metadata/HopsworksExternalClient.java b/java/hsfs/src/main/java/com/logicalclocks/hsfs/metadata/HopsworksExternalClient.java index 918aadeb1..cf356502e 100644 --- a/java/hsfs/src/main/java/com/logicalclocks/hsfs/metadata/HopsworksExternalClient.java +++ b/java/hsfs/src/main/java/com/logicalclocks/hsfs/metadata/HopsworksExternalClient.java @@ -29,6 +29,8 @@ import org.apache.http.HttpHost; import org.apache.http.HttpRequest; import org.apache.http.client.ResponseHandler; +import org.apache.http.client.config.CookieSpecs; +import org.apache.http.client.config.RequestConfig; import org.apache.http.config.Registry; import org.apache.http.config.RegistryBuilder; import org.apache.http.conn.socket.ConnectionSocketFactory; @@ -113,6 +115,7 @@ public HopsworksExternalClient(CloseableHttpClient httpClient, HttpHost httpHost httpClient = HttpClients.custom() .setConnectionManager(connectionPool) .setKeepAliveStrategy((httpResponse, httpContext) -> 30 * 1000) + .setDefaultRequestConfig(RequestConfig.custom().setCookieSpec(CookieSpecs.STANDARD).build()) .build(); if (!Strings.isNullOrEmpty(apiKeyValue)) { diff --git a/java/hsfs/src/main/java/com/logicalclocks/hsfs/metadata/HopsworksInternalClient.java b/java/hsfs/src/main/java/com/logicalclocks/hsfs/metadata/HopsworksInternalClient.java index 755938c17..0c370eb1b 100644 --- a/java/hsfs/src/main/java/com/logicalclocks/hsfs/metadata/HopsworksInternalClient.java +++ b/java/hsfs/src/main/java/com/logicalclocks/hsfs/metadata/HopsworksInternalClient.java @@ -25,6 +25,8 @@ import org.apache.http.HttpHost; import org.apache.http.HttpRequest; import org.apache.http.client.ResponseHandler; +import org.apache.http.client.config.CookieSpecs; +import org.apache.http.client.config.RequestConfig; import org.apache.http.config.Registry; import org.apache.http.config.RegistryBuilder; import org.apache.http.conn.socket.ConnectionSocketFactory; @@ -103,6 +105,7 @@ public HopsworksInternalClient() throws IOException, KeyStoreException, Certific httpClient = HttpClients.custom() .setConnectionManager(connectionPool) .setKeepAliveStrategy((httpResponse, httpContext) -> 30 * 1000) + .setDefaultRequestConfig(RequestConfig.custom().setCookieSpec(CookieSpecs.STANDARD).build()) .build(); certKey = HopsworksHttpClient.readCertKey(MATERIAL_PASSWD);