api: DeleteObject should always return 204. (#1645)

Fixes #1643
This commit is contained in:
Harshavardhana
2016-05-14 15:47:19 -07:00
parent e03ebfd13b
commit 5b29cefd40
2 changed files with 13 additions and 5 deletions

View File

@@ -936,10 +936,9 @@ func (api objectAPIHandlers) DeleteObjectHandler(w http.ResponseWriter, r *http.
return
}
}
if err := api.ObjectAPI.DeleteObject(bucket, object); err != nil {
errorIf(err, "DeleteObject failed.", nil)
writeErrorResponse(w, r, toAPIErrorCode(err), r.URL.Path)
return
}
/// http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectDELETE.html
/// Ignore delete object errors, since we are suppposed to reply
/// only 204.
api.ObjectAPI.DeleteObject(bucket, object)
writeSuccessNoContent(w)
}