diff options
author | 2018-11-01 11:03:58 +0300 | |
---|---|---|
committer | 2018-11-01 11:03:58 +0300 | |
commit | 6180a82059a761ae0dd9faffa37dc911b006d1f4 (patch) | |
tree | 022340d72f561e814b2f8ce14a4e77355a98abf5 /juick-server/src/main/java/com/juick/server | |
parent | 9ce4cc8492522f0255d839fb13e3c09bbc87be7f (diff) |
log http signature exceptions
Diffstat (limited to 'juick-server/src/main/java/com/juick/server')
-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); |