Browse Source

volume: return 204 for unchanged file uploads

fix https://github.com/chrislusf/seaweedfs/issues/1196
pull/1198/head
Chris Lu 5 years ago
parent
commit
2a6db0fd43
  1. 5
      weed/server/volume_server_handlers_write.go

5
weed/server/volume_server_handlers_write.go

@ -52,9 +52,10 @@ func (vs *VolumeServer) PostHandler(w http.ResponseWriter, r *http.Request) {
ret := operation.UploadResult{} ret := operation.UploadResult{}
_, isUnchanged, writeError := topology.ReplicatedWrite(vs.GetMaster(), vs.store, volumeId, needle, r) _, isUnchanged, writeError := topology.ReplicatedWrite(vs.GetMaster(), vs.store, volumeId, needle, r)
// http 304 status code does not allow body
// http 204 status code does not allow body
if writeError == nil && isUnchanged { if writeError == nil && isUnchanged {
w.WriteHeader(http.StatusNotModified)
setEtag(w, needle.Etag())
w.WriteHeader(http.StatusNoContent)
return return
} }

Loading…
Cancel
Save