diff options
author | Jesús Espino <jespinog@gmail.com> | 2018-07-18 10:07:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-18 10:07:00 +0200 |
commit | b367b1ff4064557deacae0f7ecf77fae4624b8c6 (patch) | |
tree | 5b9218d64d0e659424db97c996bd20fa1e7ee8d9 /api4/team.go | |
parent | e718d2544f6c719bc6e31f569400f44d54de3a34 (diff) | |
download | chat-b367b1ff4064557deacae0f7ecf77fae4624b8c6.tar.gz chat-b367b1ff4064557deacae0f7ecf77fae4624b8c6.tar.bz2 chat-b367b1ff4064557deacae0f7ecf77fae4624b8c6.zip |
Do not close the connection abruptly on too big file uploads (#9083)
Diffstat (limited to 'api4/team.go')
-rw-r--r-- | api4/team.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/api4/team.go b/api4/team.go index adb8ae355..6fbc537e9 100644 --- a/api4/team.go +++ b/api4/team.go @@ -7,6 +7,8 @@ import ( "bytes" "encoding/base64" "fmt" + "io" + "io/ioutil" "net/http" "strconv" @@ -796,6 +798,8 @@ func getTeamIcon(c *Context, w http.ResponseWriter, r *http.Request) { } func setTeamIcon(c *Context, w http.ResponseWriter, r *http.Request) { + defer io.Copy(ioutil.Discard, r.Body) + c.RequireTeamId() if c.Err != nil { return |