mirror of https://github.com/minio/minio.git
Merge pull request #1075 from harshavardhana/content-type
statObject: Make sure to lowercase file extensions.
This commit is contained in:
commit
e39b6caada
|
@ -435,7 +435,7 @@ func (fs Filesystem) CompleteMultipartUpload(bucket, object, uploadID string, da
|
|||
}
|
||||
contentType := "application/octet-stream"
|
||||
if objectExt := filepath.Ext(objectPath); objectExt != "" {
|
||||
contentType = contentdb.MustLookup(strings.TrimPrefix(objectExt, "."))
|
||||
contentType = contentdb.MustLookup(strings.ToLower(strings.TrimPrefix(objectExt, ".")))
|
||||
}
|
||||
newObject := ObjectMetadata{
|
||||
Bucket: bucket,
|
||||
|
|
|
@ -155,7 +155,7 @@ func getMetadata(rootPath, bucket, object string) (ObjectMetadata, *probe.Error)
|
|||
object = sanitizeWindowsPath(object)
|
||||
}
|
||||
if objectExt := filepath.Ext(object); objectExt != "" {
|
||||
contentType = contentdb.MustLookup(strings.TrimPrefix(objectExt, "."))
|
||||
contentType = contentdb.MustLookup(strings.ToLower(strings.TrimPrefix(objectExt, ".")))
|
||||
}
|
||||
metadata := ObjectMetadata{
|
||||
Bucket: bucket,
|
||||
|
@ -285,7 +285,7 @@ func (fs Filesystem) CreateObject(bucket, object, expectedMD5Sum string, size in
|
|||
}
|
||||
contentType := "application/octet-stream"
|
||||
if objectExt := filepath.Ext(objectPath); objectExt != "" {
|
||||
contentType = contentdb.MustLookup(strings.TrimPrefix(objectExt, "."))
|
||||
contentType = contentdb.MustLookup(strings.ToLower(strings.TrimPrefix(objectExt, ".")))
|
||||
}
|
||||
newObject := ObjectMetadata{
|
||||
Bucket: bucket,
|
||||
|
|
Loading…
Reference in New Issue