mirror of
https://github.com/pgsty/minio.git
synced 2026-07-21 13:10:22 +03:00
Switching from base64 to hex for etag
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user