mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-19 23:49:23 +08:00
Merge pull request #1169 from stlpmo-jn/http_304_has_no_resp_body
remove the http 304 response body
This commit is contained in:
@@ -51,10 +51,14 @@ 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)
|
||||||
httpStatus := http.StatusCreated
|
|
||||||
if isUnchanged {
|
// http 304 status code does not allow body
|
||||||
httpStatus = http.StatusNotModified
|
if writeError == nil && isUnchanged {
|
||||||
|
w.WriteHeader(http.StatusNotModified)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
httpStatus := http.StatusCreated
|
||||||
if writeError != nil {
|
if writeError != nil {
|
||||||
httpStatus = http.StatusInternalServerError
|
httpStatus = http.StatusInternalServerError
|
||||||
ret.Error = writeError.Error()
|
ret.Error = writeError.Error()
|
||||||
|
Reference in New Issue
Block a user