From cf61b2fc3c3ae6201e7a007ac11690700a6d619a Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 26 Apr 2018 10:21:30 +0300 Subject: api: empty post should return 400 --- juick-api/src/main/java/com/juick/server/api/Post.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'juick-api/src/main') diff --git a/juick-api/src/main/java/com/juick/server/api/Post.java b/juick-api/src/main/java/com/juick/server/api/Post.java index 5757db09..d007b9af 100644 --- a/juick-api/src/main/java/com/juick/server/api/Post.java +++ b/juick-api/src/main/java/com/juick/server/api/Post.java @@ -93,6 +93,10 @@ public class Post { } } } + if (StringUtils.isBlank(body) && StringUtils.isBlank(attachmentFName.toString())) { + // Should be there for compatibility + throw new HttpBadRequestException(); + } return commandsManager.processCommand(visitor, body, attachmentFName); } -- cgit v1.2.3