From 07ebf86ab279811c365e8174807dbf36fc2f4ca4 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 10 Nov 2020 16:36:02 +0300 Subject: ActivityPub: Digest header is mandatory now for POST requests --- src/main/java/com/juick/ActivityPubManager.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/main/java/com/juick/ActivityPubManager.java') diff --git a/src/main/java/com/juick/ActivityPubManager.java b/src/main/java/com/juick/ActivityPubManager.java index e3b1ac8e..22fe826f 100644 --- a/src/main/java/com/juick/ActivityPubManager.java +++ b/src/main/java/com/juick/ActivityPubManager.java @@ -54,6 +54,7 @@ import java.io.IOException; import java.io.StringWriter; import java.io.Writer; import java.net.URI; +import java.security.NoSuchAlgorithmException; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -104,7 +105,7 @@ public class ActivityPubManager implements ActivityListener, NotificationListene signatureManager.post(me, follower, accept); socialService.addFollower(followedUser, follower.getId()); logger.info("Follower added for {}", followedUser.getName()); - } catch (IOException e) { + } catch (IOException | NoSuchAlgorithmException e) { logger.info("activitypub exception", e); } } @@ -145,7 +146,7 @@ public class ActivityPubManager implements ActivityListener, NotificationListene try { logger.info("Deletion to follower {}", follower.getId()); signatureManager.post(me, follower, delete); - } catch (IOException e) { + } catch (IOException | NoSuchAlgorithmException e) { logger.warn("activitypub exception", e); } }); @@ -194,7 +195,7 @@ public class ActivityPubManager implements ActivityListener, NotificationListene try { logger.info("Update to follower {}", follower.getId()); signatureManager.post(me, follower, update); - } catch (IOException e) { + } catch (IOException | NoSuchAlgorithmException e) { logger.warn("activitypub exception", e); } }); @@ -239,7 +240,7 @@ public class ActivityPubManager implements ActivityListener, NotificationListene create.setObject(note); try { signatureManager.post(me, follower, create); - } catch (IOException e) { + } catch (IOException | NoSuchAlgorithmException e) { logger.warn("activitypub exception", e); } } @@ -386,7 +387,7 @@ public class ActivityPubManager implements ActivityListener, NotificationListene try { logger.info("Announcing top: {}", message.getMid()); signatureManager.post(me, (Person)person, announce); - } catch (IOException e) { + } catch (IOException | NoSuchAlgorithmException e) { logger.warn("activitypub exception", e); } }, () -> logger.warn("Follower not found: {}", acct)); -- cgit v1.2.3