From 7ed222be2ba50448e621b4090ebafc492708c744 Mon Sep 17 00:00:00 2001 From: tkuzynow Date: Wed, 3 Apr 2024 16:05:52 +0200 Subject: [PATCH] fix: classCastException for RedirectStategy in messageService --- .../videoservice/api/service/message/MessageService.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/main/java/de/caritas/cob/videoservice/api/service/message/MessageService.java b/src/main/java/de/caritas/cob/videoservice/api/service/message/MessageService.java index 05de2c7..f8aa821 100644 --- a/src/main/java/de/caritas/cob/videoservice/api/service/message/MessageService.java +++ b/src/main/java/de/caritas/cob/videoservice/api/service/message/MessageService.java @@ -13,9 +13,8 @@ import java.time.LocalDateTime; import lombok.extern.slf4j.Slf4j; import org.apache.hc.client5.http.classic.HttpClient; +import org.apache.hc.client5.http.impl.DefaultRedirectStrategy; import org.apache.hc.client5.http.impl.classic.HttpClientBuilder; -import org.apache.hc.client5.http.protocol.RedirectStrategy; -import org.apache.http.impl.client.LaxRedirectStrategy; import org.json.JSONObject; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; @@ -51,9 +50,7 @@ public MessageControllerApi getMessageControllerApi() { final HttpComponentsClientHttpRequestFactory factory = new HttpComponentsClientHttpRequestFactory(); final HttpClient httpClient = - HttpClientBuilder.create() - .setRedirectStrategy((RedirectStrategy) new LaxRedirectStrategy()) - .build(); + HttpClientBuilder.create().setRedirectStrategy(new DefaultRedirectStrategy()).build(); factory.setHttpClient(httpClient); restTemplate.setRequestFactory(factory); de.caritas.cob.videoservice.messageservice.generated.ApiClient apiClient =