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