aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java/com/juick/server/SignatureManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'juick-server/src/main/java/com/juick/server/SignatureManager.java')
-rw-r--r--juick-server/src/main/java/com/juick/server/SignatureManager.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/juick-server/src/main/java/com/juick/server/SignatureManager.java b/juick-server/src/main/java/com/juick/server/SignatureManager.java
index e9227b9d..4fa6c5ff 100644
--- a/juick-server/src/main/java/com/juick/server/SignatureManager.java
+++ b/juick-server/src/main/java/com/juick/server/SignatureManager.java
@@ -41,6 +41,8 @@ public class SignatureManager {
private ObjectMapper jsonMapper;
@Inject
private ApplicationEventPublisher applicationEventPublisher;
+ @Inject
+ private RestTemplate apClient;
public void post(Person from, Person to, Context data) throws IOException {
UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.fromUriString(to.getInbox());
@@ -85,7 +87,7 @@ public class SignatureManager {
}
public Optional<Context> getContext(URI contextUri) {
try {
- return Optional.of(new RestTemplate().getForEntity(contextUri, Context.class).getBody());
+ return Optional.of(apClient.getForEntity(contextUri, Context.class).getBody());
} catch (HttpClientErrorException e) {
logger.warn("Cannot identify {}", contextUri);
if (e.getStatusCode().equals(HttpStatus.GONE)) {