diff --git a/weed/operation/upload_content.go b/weed/operation/upload_content.go index 722bd352a..1312911ba 100644 --- a/weed/operation/upload_content.go +++ b/weed/operation/upload_content.go @@ -455,6 +455,7 @@ func (uploader *Uploader) upload_content(ctx context.Context, fillBufferFunction etag := getEtag(resp) if resp.StatusCode == http.StatusNoContent { ret.ETag = etag + ret.ContentMd5 = resp.Header.Get("Content-MD5") return &ret, nil } diff --git a/weed/server/volume_server_handlers_write.go b/weed/server/volume_server_handlers_write.go index 418f3c235..3477a411f 100644 --- a/weed/server/volume_server_handlers_write.go +++ b/weed/server/volume_server_handlers_write.go @@ -57,6 +57,7 @@ func (vs *VolumeServer) PostHandler(w http.ResponseWriter, r *http.Request) { // http 204 status code does not allow body if writeError == nil && isUnchanged { SetEtag(w, reqNeedle.Etag()) + w.Header().Set("Content-MD5", contentMd5) w.WriteHeader(http.StatusNoContent) return }