mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-22 21:03:32 +08:00
We return etag using the same algorithm as aws s3
https://teppen.io/2018/06/23/aws_s3_etags/
This commit is contained in:
@@ -13,6 +13,7 @@ import (
|
||||
"github.com/chrislusf/seaweedfs/weed/stats"
|
||||
"github.com/chrislusf/seaweedfs/weed/storage/needle"
|
||||
"github.com/chrislusf/seaweedfs/weed/topology"
|
||||
"github.com/chrislusf/seaweedfs/weed/util"
|
||||
)
|
||||
|
||||
func (vs *VolumeServer) PostHandler(w http.ResponseWriter, r *http.Request) {
|
||||
@@ -67,7 +68,7 @@ func (vs *VolumeServer) PostHandler(w http.ResponseWriter, r *http.Request) {
|
||||
ret.Name = string(reqNeedle.Name)
|
||||
}
|
||||
ret.Size = uint32(originalSize)
|
||||
ret.ETag = reqNeedle.Etag()
|
||||
ret.ETag = fmt.Sprintf("%x", util.Base64Md5ToBytes(contentMd5))
|
||||
ret.Mime = string(reqNeedle.Mime)
|
||||
setEtag(w, ret.ETag)
|
||||
w.Header().Set("Content-MD5", contentMd5)
|
||||
|
Reference in New Issue
Block a user