Skip to content

Commit

Permalink
[FSTORE-1631] Http client shows warnings when response contains cooki…
Browse files Browse the repository at this point in the history
…es (#423)
  • Loading branch information
bubriks authored Dec 5, 2024
1 parent 0e335df commit ccabb28
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit ccabb28

Please sign in to comment.