Skip to content
Snippets Groups Projects
Commit 3452e11e authored by Bruce Flynn's avatar Bruce Flynn
Browse files

fix: close file on upload

parent db11c6fb
Branches main
No related tags found
No related merge requests found
Pipeline #31618 failed with stage
......@@ -52,6 +52,8 @@ func createUploadHandler(dir string) http.HandlerFunc {
httpFail(w, r, "Could not complete upload", err)
return
}
defer f.Close()
if _, err := io.Copy(f, r.Body); err != nil {
httpFail(w, r, "Could not complete upload", err)
return
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment