mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-10-28 16:00:37 +01:00
filer: return not found 404 status if not found
fix https://github.com/chrislusf/seaweedfs/issues/1160
This commit is contained in:
1 parent
ef3ae3cd41
commit
36ddca9d1f
1 file changed
+5
-1
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user