mirror of
https://github.com/minio/minio.git
synced 2025-11-20 01:50:24 -05:00
XL: Multipart update uploads.json properly. (#1741)
This commit is contained in:
committed by
Harshavardhana
parent
ed43d5e02b
commit
a00a5c6e7e
@@ -23,8 +23,12 @@ import (
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/minio/minio/pkg/mimedb"
|
||||
)
|
||||
|
||||
// ListMultipartUploads - list multipart uploads.
|
||||
@@ -54,11 +58,16 @@ func (xl xlObjects) newMultipartUploadCommon(bucket string, object string, meta
|
||||
}
|
||||
|
||||
xlMeta := xlMetaV1{}
|
||||
xlMeta.Format = "xl"
|
||||
xlMeta.Version = "1"
|
||||
// If not set default to "application/octet-stream"
|
||||
if meta["content-type"] == "" {
|
||||
meta["content-type"] = "application/octet-stream"
|
||||
contentType := "application/octet-stream"
|
||||
if objectExt := filepath.Ext(object); objectExt != "" {
|
||||
content, ok := mimedb.DB[strings.ToLower(strings.TrimPrefix(objectExt, "."))]
|
||||
if ok {
|
||||
contentType = content.ContentType
|
||||
}
|
||||
}
|
||||
meta["content-type"] = contentType
|
||||
}
|
||||
xlMeta.Meta = meta
|
||||
|
||||
|
||||
Reference in New Issue
Block a user