From 6720cbc0d9f2d34a8f727874b0dd5d056f506c0c Mon Sep 17 00:00:00 2001 From: mappu Date: Sat, 25 Jul 2020 12:25:44 +1200 Subject: [PATCH] upload: buffer MIME parsing on disk, not in memory --- upload.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upload.go b/upload.go index 6b7e30b..a73d6a1 100644 --- a/upload.go +++ b/upload.go @@ -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)