Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

volume: return 204 for unchanged file uploads

Chris Lu2a6db0fd436a
diff --git a/weed/server/volume_server_handlers_write.go b/weed/server/volume_server_handlers_write.go
index cd35255e52..ac8fa4f420 100644
--- a/weed/server/volume_server_handlers_write.go
+++ b/weed/server/volume_server_handlers_write.go
@@ -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
}