aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/config
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2021-01-16 10:52:19 +0300
committerGravatar Vitaly Takmazov2021-01-16 10:52:28 +0300
commit9f6c1ad11e6d6259a5c10aa95eca169b87c7c3b4 (patch)
treee0181f064ebed28a337c852ba402fa73b65ab96a /src/main/java/com/juick/config
parent0faba6ff6c3008fbd5348bcdb9121fb89541fd46 (diff)
ActivityPub: do not serialize context twice
Diffstat (limited to 'src/main/java/com/juick/config')
-rw-r--r--src/main/java/com/juick/config/ActivityPubConfig.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main/java/com/juick/config/ActivityPubConfig.java b/src/main/java/com/juick/config/ActivityPubConfig.java
index e22946fb..661f6276 100644
--- a/src/main/java/com/juick/config/ActivityPubConfig.java
+++ b/src/main/java/com/juick/config/ActivityPubConfig.java
@@ -29,11 +29,13 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpMethod;
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
+import org.springframework.http.converter.StringHttpMessageConverter;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.web.client.RestTemplate;
import javax.inject.Inject;
import java.net.URI;
+import java.nio.charset.StandardCharsets;
import java.util.Collections;
@Configuration
@@ -69,6 +71,7 @@ public class ActivityPubConfig {
}
});
restTemplate.getMessageConverters().add(0, mappingJacksonHttpMessageConverter());
+ restTemplate.getMessageConverters().add(0, new StringHttpMessageConverter(StandardCharsets.UTF_8));
restTemplate.setErrorHandler(activityPubClientErrorHandler);
restTemplate.setInterceptors(Collections.singletonList(
new HeaderRequestInterceptor("Accept", Activity.ACTIVITY_MEDIA_TYPE)));