mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-08-24 01:37:04 +08:00
filer: return not found 404 status if not found
fix https://github.com/chrislusf/seaweedfs/issues/1160
This commit is contained in:
parent
ef3ae3cd41
commit
36ddca9d1f
@ -290,7 +290,11 @@ func (fs *FilerServer) DeleteHandler(w http.ResponseWriter, r *http.Request) {
|
||||
err := fs.filer.DeleteEntryMetaAndData(context.Background(), filer2.FullPath(r.URL.Path), isRecursive, ignoreRecursiveError, !skipChunkDeletion)
|
||||
if err != nil {
|
||||
glog.V(1).Infoln("deleting", r.URL.Path, ":", err.Error())
|
||||
writeJsonError(w, r, http.StatusInternalServerError, err)
|
||||
httpStatus := http.StatusInternalServerError
|
||||
if err == filer2.ErrNotFound {
|
||||
httpStatus = http.StatusNotFound
|
||||
}
|
||||
writeJsonError(w, r, httpStatus, err)
|
||||
return
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user