diff options
author | Vitaly Takmazov | 2019-07-01 16:52:45 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2019-07-01 16:52:45 +0300 |
commit | fb91981f06bf069ac3034135ebcbd67036675d97 (patch) | |
tree | 8b6a2250dad4b3ca6fc1236d0dedf8aa35453ea8 | |
parent | bd3f12cccc90ec81c9c6de85de700e5286007fda (diff) |
Use Apache HTTP Client for ActivityPub
-rw-r--r-- | src/main/java/com/juick/server/configuration/ActivityPubClientConfig.java | 2 |
1 files changed, 2 insertions, 0 deletions
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( |