From fb91981f06bf069ac3034135ebcbd67036675d97 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Mon, 1 Jul 2019 16:52:45 +0300 Subject: Use Apache HTTP Client for ActivityPub --- .../java/com/juick/server/configuration/ActivityPubClientConfig.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/main/java/com/juick') diff --git a/src/main/java/com/juick/server/configuration/ActivityPubClientConfig.java b/src/main/java/com/juick/server/configuration/ActivityPubClientConfig.java index 65bfeade..1cf676cd 100644 --- a/src/main/java/com/juick/server/configuration/ActivityPubClientConfig.java +++ b/src/main/java/com/juick/server/configuration/ActivityPubClientConfig.java @@ -5,6 +5,7 @@ import com.juick.server.api.activity.model.Activity; import com.juick.server.helpers.HeaderRequestInterceptor; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; import org.springframework.web.client.RestTemplate; @@ -26,6 +27,7 @@ public class ActivityPubClientConfig { @Bean public RestTemplate apClient() { RestTemplate restTemplate = new RestTemplate(); + restTemplate.setRequestFactory(new HttpComponentsClientHttpRequestFactory()); restTemplate.getMessageConverters().add(0, mappingJacksonHttpMessageConverter()); restTemplate.setErrorHandler(activityPubClientErrorHandler); restTemplate.setInterceptors(Collections.singletonList( -- cgit v1.2.3