mirror of
https://github.com/minio/minio.git
synced 2025-11-20 18:06:10 -05:00
contentType: Reply back proper contentTypes based on the file extension.
Currently the server would set 'application/octet-stream' for all objects, set this value based on the file extension transparently. This is useful in case of minio browser to facilitate displaying proper icons for the different mime data types.
This commit is contained in:
@@ -204,7 +204,9 @@ func (api CloudStorageAPI) PutObjectHandler(w http.ResponseWriter, req *http.Req
|
||||
}
|
||||
return
|
||||
}
|
||||
w.Header().Set("ETag", "\""+metadata.Md5+"\"")
|
||||
if metadata.Md5 != "" {
|
||||
w.Header().Set("ETag", "\""+metadata.Md5+"\"")
|
||||
}
|
||||
writeSuccessResponse(w, nil)
|
||||
}
|
||||
|
||||
@@ -347,7 +349,9 @@ func (api CloudStorageAPI) PutObjectPartHandler(w http.ResponseWriter, req *http
|
||||
}
|
||||
return
|
||||
}
|
||||
w.Header().Set("ETag", "\""+calculatedMD5+"\"")
|
||||
if calculatedMD5 != "" {
|
||||
w.Header().Set("ETag", "\""+calculatedMD5+"\"")
|
||||
}
|
||||
writeSuccessResponse(w, nil)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user