aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java/com/juick/server/SignatureManager.java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-11-01 13:29:29 +0300
committerGravatar Vitaly Takmazov2018-11-01 13:29:29 +0300
commit2b9d2478833a060df76c855e78c46e33c032db49 (patch)
treea516cb597704529cf1de623eb807d219a5510d49 /juick-server/src/main/java/com/juick/server/SignatureManager.java
parent0dc2727e0633a4b865d814c7ab8450e3c815e511 (diff)
ActivityPub: fix 410 error handler
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.java12
1 files changed, 4 insertions, 8 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 d43efd4a..927a62a7 100644
--- a/juick-server/src/main/java/com/juick/server/SignatureManager.java
+++ b/juick-server/src/main/java/com/juick/server/SignatureManager.java
@@ -89,15 +89,11 @@ public class SignatureManager {
return false;
}
public Optional<Context> getContext(URI contextUri) {
- try {
- return Optional.of(apClient.getForEntity(contextUri, Context.class).getBody());
- } catch (HttpClientErrorException e) {
+ Context context = apClient.getForEntity(contextUri, Context.class).getBody();
+ if (context == null) {
logger.warn("Cannot identify {}", contextUri);
- if (e.getStatusCode().equals(HttpStatus.GONE)) {
- logger.warn("Server report {} is gone, deleting", contextUri);
- applicationEventPublisher.publishEvent(new DeleteUserEvent(this, contextUri.toASCIIString()));
- }
+ return Optional.empty();
}
- return Optional.empty();
+ return Optional.of(context);
}
}