From 66faec564574352d6dd57d2f2839f64eb2391515 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 24 Aug 2021 19:57:11 +0300 Subject: ActivityPub: respond with BAD_REQUEST to Create without our recipient --- src/main/java/com/juick/www/api/activity/Profile.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main/java/com/juick/www/api/activity') diff --git a/src/main/java/com/juick/www/api/activity/Profile.java b/src/main/java/com/juick/www/api/activity/Profile.java index 667092c4..aa67d130 100644 --- a/src/main/java/com/juick/www/api/activity/Profile.java +++ b/src/main/java/com/juick/www/api/activity/Profile.java @@ -363,8 +363,7 @@ public class Profile { messagesService.updateReplyUri(result.getNewMessage().get(), noteId); return new ResponseEntity<>(result, HttpStatus.OK); } - } - return new ResponseEntity<>(CommandResult.fromString("Invalid recipient"), HttpStatus.BAD_REQUEST); + } } } else { if (note.getTo().stream().anyMatch(recipient -> recipient.startsWith(baseUri))) { @@ -373,6 +372,7 @@ public class Profile { return new ResponseEntity<>(CommandResult.fromString("Message accepted"), HttpStatus.ACCEPTED); } } + return new ResponseEntity<>(CommandResult.fromString("Invalid recipient"), HttpStatus.BAD_REQUEST); } } } -- cgit v1.2.3