MM-11189: Do not close the connection abruptly on too big emojis (#9071)
Этот коммит содержится в:
коммит произвёл
Carlos Tadeu Panato Junior
родитель
2df818b9c6
Коммит
602fd0ffdd
@@ -4,6 +4,8 @@
|
|||||||
package api4
|
package api4
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"io"
|
||||||
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
@@ -28,6 +30,8 @@ func (api *API) InitEmoji() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func createEmoji(c *Context, w http.ResponseWriter, r *http.Request) {
|
func createEmoji(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||||
|
defer io.Copy(ioutil.Discard, r.Body)
|
||||||
|
|
||||||
if !*c.App.Config().ServiceSettings.EnableCustomEmoji {
|
if !*c.App.Config().ServiceSettings.EnableCustomEmoji {
|
||||||
c.Err = model.NewAppError("createEmoji", "api.emoji.disabled.app_error", nil, "", http.StatusNotImplemented)
|
c.Err = model.NewAppError("createEmoji", "api.emoji.disabled.app_error", nil, "", http.StatusNotImplemented)
|
||||||
return
|
return
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user