|
|
|
@ -24,8 +24,6 @@ import ( |
|
|
|
|
"strconv" |
|
|
|
|
"time" |
|
|
|
|
|
|
|
|
|
"encoding/base64" |
|
|
|
|
"encoding/hex" |
|
|
|
|
mstorage "github.com/minio-io/minio/pkg/storage" |
|
|
|
|
) |
|
|
|
|
|
|
|
|
@ -64,8 +62,7 @@ func writeObjectHeaders(w http.ResponseWriter, metadata mstorage.ObjectMetadata) |
|
|
|
|
lastModified := metadata.Created.Format(time.RFC1123) |
|
|
|
|
// common headers
|
|
|
|
|
writeCommonHeaders(w, metadata.ContentType) |
|
|
|
|
md5Bytes, _ := hex.DecodeString(metadata.Md5) |
|
|
|
|
w.Header().Set("ETag", base64.StdEncoding.EncodeToString(md5Bytes)) |
|
|
|
|
w.Header().Set("ETag", metadata.Md5) |
|
|
|
|
w.Header().Set("Last-Modified", lastModified) |
|
|
|
|
w.Header().Set("Content-Length", strconv.FormatInt(metadata.Size, 10)) |
|
|
|
|
w.Header().Set("Connection", "close") |
|
|
|
@ -76,8 +73,7 @@ func writeRangeObjectHeaders(w http.ResponseWriter, metadata mstorage.ObjectMeta |
|
|
|
|
lastModified := metadata.Created.Format(time.RFC1123) |
|
|
|
|
// common headers
|
|
|
|
|
writeCommonHeaders(w, metadata.ContentType) |
|
|
|
|
md5Bytes, _ := hex.DecodeString(metadata.Md5) |
|
|
|
|
w.Header().Set("ETag", base64.StdEncoding.EncodeToString(md5Bytes)) |
|
|
|
|
w.Header().Set("ETag", metadata.Md5) |
|
|
|
|
w.Header().Set("Last-Modified", lastModified) |
|
|
|
|
w.Header().Set("Content-Range", ra) |
|
|
|
|
w.Header().Set("Content-Length", strconv.FormatInt(metadata.Size, 10)) |
|
|
|
|