From 6699c47e787f09630438414c181caeb98f6819e1 Mon Sep 17 00:00:00 2001 From: "A.Alimohammadi" Date: Sat, 7 Oct 2023 16:22:17 +0330 Subject: [PATCH] [bug]FollowRedirects was not set in http request config in resttemplate starter --- .../core/factory/ConfigurableApacheHttpClientFactory.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tosan-httpclient-spring-boot-core/src/main/java/com/tosan/client/http/core/factory/ConfigurableApacheHttpClientFactory.java b/tosan-httpclient-spring-boot-core/src/main/java/com/tosan/client/http/core/factory/ConfigurableApacheHttpClientFactory.java index 4070f73..e17db0d 100644 --- a/tosan-httpclient-spring-boot-core/src/main/java/com/tosan/client/http/core/factory/ConfigurableApacheHttpClientFactory.java +++ b/tosan-httpclient-spring-boot-core/src/main/java/com/tosan/client/http/core/factory/ConfigurableApacheHttpClientFactory.java @@ -61,9 +61,10 @@ public HttpClientBuilder createBuilder() { private void configureTimeouts(HttpClientBuilder builder) { builder.setDefaultRequestConfig(RequestConfig.custom() - .setConnectTimeout(httpClientProperties.getConnection().getConnectionTimeout(), TimeUnit.MILLISECONDS) - .setConnectionRequestTimeout(httpClientProperties.getConnection().getSocketTimeout(), TimeUnit.MILLISECONDS) - .build()); + .setConnectTimeout(httpClientProperties.getConnection().getConnectionTimeout(), TimeUnit.MILLISECONDS) + .setConnectionRequestTimeout(httpClientProperties.getConnection().getSocketTimeout(), TimeUnit.MILLISECONDS) + .setRedirectsEnabled(httpClientProperties.getConnection().isFollowRedirects()) + .build()); } private void configureConnectionManager(HttpClientBuilder builder) {