mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
Merge pull request #1091 from divinerapier/fix/abused-404
fix abused 404 status code
This commit is contained in:
commit
1b71608b3c
|
@ -32,10 +32,15 @@ func (fs *FilerServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request,
|
|||
fs.listDirectoryHandler(w, r)
|
||||
return
|
||||
}
|
||||
glog.V(1).Infof("Not found %s: %v", path, err)
|
||||
|
||||
stats.FilerRequestCounter.WithLabelValues("read.notfound").Inc()
|
||||
w.WriteHeader(http.StatusNotFound)
|
||||
if err == filer2.ErrNotFound {
|
||||
glog.V(1).Infof("Not found %s: %v", path, err)
|
||||
stats.FilerRequestCounter.WithLabelValues("read.notfound").Inc()
|
||||
w.WriteHeader(http.StatusNotFound)
|
||||
} else {
|
||||
glog.V(0).Infof("Internal %s: %v", path, err)
|
||||
stats.FilerRequestCounter.WithLabelValues("read.internalerror").Inc()
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue