mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
remove the http 304 response body
This commit is contained in:
parent
a18f62bbe7
commit
f87ccbddb4
|
@ -51,10 +51,14 @@ func (vs *VolumeServer) PostHandler(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
ret := operation.UploadResult{}
|
||||
_, isUnchanged, writeError := topology.ReplicatedWrite(vs.GetMaster(), vs.store, volumeId, needle, r)
|
||||
httpStatus := http.StatusCreated
|
||||
if isUnchanged {
|
||||
httpStatus = http.StatusNotModified
|
||||
|
||||
// http 304 status code does not allow body
|
||||
if writeError == nil && isUnchanged {
|
||||
w.WriteHeader(http.StatusNotModified)
|
||||
return
|
||||
}
|
||||
|
||||
httpStatus := http.StatusCreated
|
||||
if writeError != nil {
|
||||
httpStatus = http.StatusInternalServerError
|
||||
ret.Error = writeError.Error()
|
||||
|
|
Loading…
Reference in a new issue