summaryrefslogtreecommitdiffstats
path: root/app/webhook.go
diff options
context:
space:
mode:
authorChristopher Brown <ccbrown112@gmail.com>2017-10-16 23:10:45 -0500
committerChristopher Brown <ccbrown112@gmail.com>2017-10-16 23:10:45 -0500
commit39cc2372695836fdc96059d8b94992b1416f98e1 (patch)
tree56d2beb5420cd0054194f71e53c6a95578beff9a /app/webhook.go
parent89dc3cb126ba46b486997c433adfdf34982fcc81 (diff)
parent8bf47c1211d09079fd9407555026b7b29383ac37 (diff)
downloadchat-39cc2372695836fdc96059d8b94992b1416f98e1.tar.gz
chat-39cc2372695836fdc96059d8b94992b1416f98e1.tar.bz2
chat-39cc2372695836fdc96059d8b94992b1416f98e1.zip
Merge branch 'release-4.3'
Diffstat (limited to 'app/webhook.go')
-rw-r--r--app/webhook.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/webhook.go b/app/webhook.go
index dbe444a25..231fe1529 100644
--- a/app/webhook.go
+++ b/app/webhook.go
@@ -131,6 +131,11 @@ func (a *App) CreateWebhookPost(userId string, channel *model.Channel, text, ove
post := &model.Post{UserId: userId, ChannelId: channel.Id, Message: text, Type: postType}
post.AddProp("from_webhook", "true")
+ if strings.HasPrefix(post.Type, model.POST_SYSTEM_MESSAGE_PREFIX) {
+ err := model.NewAppError("CreateWebhookPost", "api.context.invalid_param.app_error", map[string]interface{}{"Name": "post.type"}, "", http.StatusBadRequest)
+ return nil, err
+ }
+
if metrics := a.Metrics; metrics != nil {
metrics.IncrementWebhookPost()
}