Do not close the connection abruptly on too big file uploads (#9083)

Этот коммит содержится в:
Jesús Espino
2018-07-18 10:07:00 +02:00
коммит произвёл GitHub
родитель e718d2544f
Коммит b367b1ff40
4 изменённых файлов: 15 добавлений и 0 удалений

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

@@ -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