mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
volume: return 204 for unchanged file uploads
fix https://github.com/chrislusf/seaweedfs/issues/1196
This commit is contained in:
parent
33b3bd467c
commit
2a6db0fd43
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue