fix: prevents blank messages from being posted to chat (#8257)

* fix: throws an error when the server receives a post chat request with a message containing only whitespace.

* Adding a test confirming behavior around messages that only contain newlines.

* Removing accidental only that was left on a test
This commit is contained in:
Travis
2017-01-03 08:15:31 -06:00
committed by Keith Holliday
parent d905ab7f86
commit 03c4d82b7d
2 changed files with 19 additions and 0 deletions

View File

@@ -93,6 +93,7 @@ api.postChat = {
let chatUpdated;
req.checkParams('groupId', res.t('groupIdRequired')).notEmpty();
req.sanitize('message').trim();
req.checkBody('message', res.t('messageGroupChatBlankMessage')).notEmpty();
let validationErrors = req.validationErrors();