upload: buffer MIME parsing on disk, not in memory

This commit is contained in:
mappu 2020-07-25 12:25:44 +12:00
parent 8d11b7c434
commit 6720cbc0d9

View File

@ -20,7 +20,7 @@ func (this *Server) handleUpload(w http.ResponseWriter, r *http.Request) {
remoteIP := this.remoteIP(r)
err := r.ParseMultipartForm(this.opts.MaxUploadBytes * 2)
err := r.ParseMultipartForm(0) // buffer upload in temporary files on disk, not memory
if err != nil {
log.Printf("%s Invalid request: %s\n", remoteIP, err.Error())
http.Error(w, "Invalid request", 400)