don't panic if incoming webhook contains invalid json
Этот коммит содержится в:
@@ -983,6 +983,11 @@ func incomingWebhook(c *api.Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
parsedRequest = model.IncomingWebhookRequestFromJson(strings.NewReader(r.FormValue("payload")))
|
parsedRequest = model.IncomingWebhookRequestFromJson(strings.NewReader(r.FormValue("payload")))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if parsedRequest == nil {
|
||||||
|
c.Err = model.NewAppError("incomingWebhook", "Unable to parse incoming data", "")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
text := parsedRequest.Text
|
text := parsedRequest.Text
|
||||||
if len(text) == 0 {
|
if len(text) == 0 {
|
||||||
c.Err = model.NewAppError("incomingWebhook", "No text specified", "")
|
c.Err = model.NewAppError("incomingWebhook", "No text specified", "")
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user