mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-23 05:13:35 +08:00
volume: return 204 for unchanged file uploads
fix https://github.com/chrislusf/seaweedfs/issues/1196
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user