diff options
Diffstat (limited to 'juick-server/src/main/java')
-rw-r--r-- | juick-server/src/main/java/com/juick/server/SignatureManager.java | 11 |
1 files changed, 8 insertions, 3 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 f152796c..8e93846f 100644 --- a/juick-server/src/main/java/com/juick/server/SignatureManager.java +++ b/juick-server/src/main/java/com/juick/server/SignatureManager.java @@ -62,10 +62,15 @@ public class SignatureManager { requestHeaders.add("Signature", signature.toString().substring(10)); HttpEntity<Context> request = new HttpEntity<>(Context.build(data), requestHeaders); //boolean valid = verifySignature(Signature.fromString(requestHeaders.getFirst("Signature")), - // keystoreManager.getPublicKey(), "POST", inbox.getPath(), headers); + // keystoreManager.getPublicKey(), "POST", inbox.getPath(), headers); logger.info("Sending context: {}", jsonMapper.writeValueAsString(data)); - ResponseEntity<Void> response = apClient.postForEntity(inbox, request, Void.class); - logger.info("accepted follower: {}", response.getStatusCodeValue()); + try { + ResponseEntity<Void> response = apClient.postForEntity(inbox, request, Void.class); + logger.info("accepted follower: {}", response.getStatusCodeValue()); + } catch (HttpClientErrorException e) { + logger.warn("Signature exception", e); + } + } public boolean verifySignature(String signatureString, URI actor, String method, String path, Map<String, String> headers) { Optional<Context> context = getContext(actor); |