diff options
Diffstat (limited to 'src/main/java/com/juick')
-rw-r--r-- | src/main/java/com/juick/www/api/activity/Profile.java | 6 |
1 files changed, 3 insertions, 3 deletions
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 aa67d130..c2b36cbe 100644 --- a/src/main/java/com/juick/www/api/activity/Profile.java +++ b/src/main/java/com/juick/www/api/activity/Profile.java @@ -286,7 +286,6 @@ public class Profile { Context.ACTIVITYSTREAMS_PROFILE_MEDIA_TYPE }) public ResponseEntity<CommandResult> processInbox(@Visitor User visitor, InputStream inboxData) throws Exception { String inbox = IOUtils.toString(inboxData, StandardCharsets.UTF_8); - logger.info("Inbox: {}", StringEscapeUtils.unescapeJava(inbox)); Activity activity = jsonMapper.readValue(inbox, Activity.class); if ((StringUtils.isNotEmpty(visitor.getUri().toString()) && visitor.getUri().equals(URI.create(activity.getActor()))) || !visitor.isAnonymous()) { @@ -294,7 +293,6 @@ public class Profile { Follow followRequest = (Follow) activity; applicationEventPublisher.publishEvent(new FollowEvent(this, followRequest)); return new ResponseEntity<>(CommandResult.fromString("Follow request accepted"), HttpStatus.ACCEPTED); - } if (activity instanceof Undo) { Activity object = (Activity) activity.getObject(); @@ -339,6 +337,7 @@ public class Profile { messagesService.updateReplyUri(result.getNewMessage().get(), noteId); return new ResponseEntity<>(result, HttpStatus.OK); } else { + logger.warn("Invalid request: {}", inbox); return new ResponseEntity<>(result, HttpStatus.BAD_REQUEST); } } else { @@ -372,7 +371,8 @@ public class Profile { return new ResponseEntity<>(CommandResult.fromString("Message accepted"), HttpStatus.ACCEPTED); } } - return new ResponseEntity<>(CommandResult.fromString("Invalid recipient"), HttpStatus.BAD_REQUEST); + logger.warn("Request with invalid recipient from {}", activity.getActor()); + return new ResponseEntity<>(CommandResult.fromString("Message accepted"), HttpStatus.ACCEPTED); } } } |