Do not close the connection abruptly on too big file uploads (#9083)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
e718d2544f
Коммит
b367b1ff40
@@ -5,6 +5,7 @@ package api4
|
||||
|
||||
import (
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
@@ -56,6 +57,8 @@ func (api *API) InitFile() {
|
||||
}
|
||||
|
||||
func uploadFile(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
defer io.Copy(ioutil.Discard, r.Body)
|
||||
|
||||
if !*c.App.Config().FileSettings.EnableFileAttachments {
|
||||
c.Err = model.NewAppError("uploadFile", "api.file.attachments.disabled.app_error", nil, "", http.StatusNotImplemented)
|
||||
return
|
||||
|
||||
Ссылка в новой задаче
Block a user