Browse Source

set etag in response

pull/815/head
Chris Lu 6 years ago
parent
commit
e49a38842a
  1. 2
      weed/operation/upload_content.go
  2. 3
      weed/server/volume_server_handlers_write.go

2
weed/operation/upload_content.go

@ -22,7 +22,7 @@ type UploadResult struct {
Name string `json:"name,omitempty"` Name string `json:"name,omitempty"`
Size uint32 `json:"size,omitempty"` Size uint32 `json:"size,omitempty"`
Error string `json:"error,omitempty"` Error string `json:"error,omitempty"`
ETag string `json:"error,omitempty"`
ETag string `json:"eTag,omitempty"`
} }
var ( var (

3
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.Name = string(needle.Name)
} }
ret.Size = uint32(originalSize) ret.Size = uint32(originalSize)
setEtag(w, needle.Etag())
ret.ETag = needle.Etag()
setEtag(w, ret.ETag)
writeJsonQuiet(w, r, httpStatus, ret) writeJsonQuiet(w, r, httpStatus, ret)
} }

Loading…
Cancel
Save