volume: return 204 for unchanged file uploads

fix https://github.com/chrislusf/seaweedfs/issues/1196
This commit is contained in:
Chris Lu 2020-02-11 09:45:02 -08:00
parent 33b3bd467c
commit 2a6db0fd43

View file

@ -52,9 +52,10 @@ func (vs *VolumeServer) PostHandler(w http.ResponseWriter, r *http.Request) {
ret := operation.UploadResult{}
_, 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 {
w.WriteHeader(http.StatusNotModified)
setEtag(w, needle.Etag())
w.WriteHeader(http.StatusNoContent)
return
}