use MD5 for ETag to be consistent with Amazon S3

This commit is contained in:
Chris Lu
2018-11-08 21:41:02 -08:00
parent 6e53c38c2f
commit a4ceb051a7
4 changed files with 51 additions and 6 deletions

View File

@@ -92,7 +92,11 @@ func (vs *VolumeServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request)
w.WriteHeader(http.StatusNotModified)
return
}
setEtag(w, n.Etag())
if r.Header.Get("ETag-MD5") == "True" {
setEtag(w, n.MD5())
}else{
setEtag(w, n.Etag())
}
if n.HasPairs() {
pairMap := make(map[string]string)