Skip to content

Commit

Permalink
fix: store dir error info (#4605)
Browse files Browse the repository at this point in the history
  • Loading branch information
notanatol committed Mar 11, 2024
1 parent d3d6685 commit a54e48a
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions pkg/api/dirs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit a54e48a

Please sign in to comment.