MM-11189: Do not close the connection abruptly on too big emojis (#9071)

Этот коммит содержится в:
Jesús Espino
2018-07-10 10:55:24 +02:00
коммит произвёл Carlos Tadeu Panato Junior
родитель 2df818b9c6
Коммит 602fd0ffdd

Просмотреть файл

@@ -4,6 +4,8 @@
package api4
import (
"io"
"io/ioutil"
"net/http"
"strings"
@@ -28,6 +30,8 @@ func (api *API) InitEmoji() {
}
func createEmoji(c *Context, w http.ResponseWriter, r *http.Request) {
defer io.Copy(ioutil.Discard, r.Body)
if !*c.App.Config().ServiceSettings.EnableCustomEmoji {
c.Err = model.NewAppError("createEmoji", "api.emoji.disabled.app_error", nil, "", http.StatusNotImplemented)
return