Merge pull request #1729 from hmhealey/plt886

PLT-886 Add additional max file size checks
Этот коммит содержится в:
Joram Wilander
2015-12-15 09:54:16 -05:00
родитель 2980a56370 76e1f1f613
Коммит ba149bd971
2 изменённых файлов: 10 добавлений и 0 удалений

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

@@ -76,6 +76,12 @@ func uploadFile(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
if r.ContentLength > model.MAX_FILE_SIZE {
c.Err = model.NewAppError("uploadFile", "Unable to upload file. File is too large.", "")
c.Err.StatusCode = http.StatusRequestEntityTooLarge
return
}
err := r.ParseMultipartForm(model.MAX_FILE_SIZE)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)