From a54e48acd85957cb3cd8bee0537e4771cf0ff4ba Mon Sep 17 00:00:00 2001 From: Anatol <87016465+notanatol@users.noreply.github.com> Date: Mon, 11 Mar 2024 09:38:42 -0600 Subject: [PATCH] fix: store dir error info (#4605) --- pkg/api/dirs.go | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/pkg/api/dirs.go b/pkg/api/dirs.go index 06aff9c59d6..05431c61f01 100644 --- a/pkg/api/dirs.go +++ b/pkg/api/dirs.go @@ -276,25 +276,14 @@ func (m *multipartReader) Next() (*FileInfo, error) { if filePath == "" { filePath = part.FormName() } - if filePath == "" { - return nil, errors.New("filepath missing") - } fileName := filepath.Base(filePath) contentType := part.Header.Get(ContentTypeHeader) - if contentType == "" { - return nil, errors.New("content-type missing") - } contentLength := part.Header.Get(ContentLengthHeader) - if contentLength == "" { - return nil, errors.New("content-length missing") - } - fileSize, err := strconv.ParseInt(contentLength, 10, 64) - if err != nil { - return nil, errors.New("invalid file size") - } + + fileSize, _ := strconv.ParseInt(contentLength, 10, 64) return &FileInfo{ Path: filePath,