aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-11-19 23:03:53 +0300
committerGravatar Vitaly Takmazov2018-11-19 23:03:53 +0300
commit74740d5d989f11746266a994840f89e9f6784f73 (patch)
tree9b9ffa37732da30f7dc04a8454fd369baf01de58 /src/main/java
parent688c8e5760a4a941acae2ebf5ebde5003d4d5eb2 (diff)
trying to switch ActivityPub RestTemplate to OkHttp
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/com/juick/server/configuration/ActivityPubClientConfig.java6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/main/java/com/juick/server/configuration/ActivityPubClientConfig.java b/src/main/java/com/juick/server/configuration/ActivityPubClientConfig.java
index 9bc1b656..43b638fe 100644
--- a/src/main/java/com/juick/server/configuration/ActivityPubClientConfig.java
+++ b/src/main/java/com/juick/server/configuration/ActivityPubClientConfig.java
@@ -2,7 +2,7 @@ package com.juick.server.configuration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
-import org.springframework.http.client.SimpleClientHttpRequestFactory;
+import org.springframework.http.client.OkHttp3ClientHttpRequestFactory;
import org.springframework.web.client.RestTemplate;
import javax.inject.Inject;
@@ -13,9 +13,7 @@ public class ActivityPubClientConfig {
ActivityPubClientErrorHandler activityPubClientErrorHandler;
@Bean
public RestTemplate apClient() {
- SimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory();
- requestFactory.setOutputStreaming(false);
- RestTemplate restTemplate = new RestTemplate(requestFactory);
+ RestTemplate restTemplate = new RestTemplate(new OkHttp3ClientHttpRequestFactory());
restTemplate.setErrorHandler(activityPubClientErrorHandler);
return restTemplate;
}