aboutsummaryrefslogtreecommitdiff
path: root/juick-api
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-04-26 10:21:30 +0300
committerGravatar Vitaly Takmazov2018-04-26 10:21:30 +0300
commitcf61b2fc3c3ae6201e7a007ac11690700a6d619a (patch)
tree1b3dbb59d76f28d045104007a2b2a26f81d0b196 /juick-api
parenta7825dede977692c0418119159090290e4f6ac34 (diff)
api: empty post should return 400
Diffstat (limited to 'juick-api')
-rw-r--r--juick-api/src/main/java/com/juick/server/api/Post.java4
1 files changed, 4 insertions, 0 deletions
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);
}