Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions server/handler/tarball.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,13 @@ func (h *tarballUploader) upload(r *http.Request) (*simpleResponse, statusError)
sid := mux.Vars(r)["sid"]
logprinter.Infof("Uploading tarball, sid: %s", sid)

if err := r.ParseMultipartForm(MaxMemory); err != nil {
// TODO: log error here
return nil, ErrorInvalidTarball
}

file, handler, err := r.FormFile("file")
if err != nil {
// TODO: log error here
return nil, ErrorInvalidTarball
}
defer file.Close()
defer r.MultipartForm.RemoveAll()

if err := h.sm.Write(sid, handler.Filename, file); err != nil {
logprinter.Errorf("Error to write tarball: %s", err.Error())
Expand Down
3 changes: 3 additions & 0 deletions tools/check/golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ linters-settings:
govet:
enable:
- nilness
errcheck:
exclude-functions:
- (*mime/multipart.Form).RemoveAll

linters:
disable-all: true
Expand Down