From e49a38842a56b9229d8d2a0a81c592678b29271c Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Wed, 2 Jan 2019 12:57:54 -0800 Subject: [PATCH] set etag in response --- weed/operation/upload_content.go | 2 +- weed/server/volume_server_handlers_write.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/weed/operation/upload_content.go b/weed/operation/upload_content.go index 9b5856949..030bf5889 100644 --- a/weed/operation/upload_content.go +++ b/weed/operation/upload_content.go @@ -22,7 +22,7 @@ type UploadResult struct { Name string `json:"name,omitempty"` Size uint32 `json:"size,omitempty"` Error string `json:"error,omitempty"` - ETag string `json:"error,omitempty"` + ETag string `json:"eTag,omitempty"` } var ( diff --git a/weed/server/volume_server_handlers_write.go b/weed/server/volume_server_handlers_write.go index 1fc5b1319..fd93142e1 100644 --- a/weed/server/volume_server_handlers_write.go +++ b/weed/server/volume_server_handlers_write.go @@ -45,7 +45,8 @@ func (vs *VolumeServer) PostHandler(w http.ResponseWriter, r *http.Request) { ret.Name = string(needle.Name) } ret.Size = uint32(originalSize) - setEtag(w, needle.Etag()) + ret.ETag = needle.Etag() + setEtag(w, ret.ETag) writeJsonQuiet(w, r, httpStatus, ret) }