aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chrislusf@users.noreply.github.com>2019-10-24 09:35:54 -0700
committerGitHub <noreply@github.com>2019-10-24 09:35:54 -0700
commit1b71608b3cfbaea884c4e7e60ac32de337374d25 (patch)
treebf7ec3381858a9c8271bf659b76ed9a671d15f9e
parent5d788714877ff4e64ca11c4d5f4be0e0f6e6ec7f (diff)
parentf1ee6b7a5470024a92226667ed610346abd40e49 (diff)
downloadseaweedfs-1b71608b3cfbaea884c4e7e60ac32de337374d25.tar.xz
seaweedfs-1b71608b3cfbaea884c4e7e60ac32de337374d25.zip
Merge pull request #1091 from divinerapier/fix/abused-404
fix abused 404 status code
-rw-r--r--weed/server/filer_server_handlers_read.go13
1 files changed, 9 insertions, 4 deletions
diff --git a/weed/server/filer_server_handlers_read.go b/weed/server/filer_server_handlers_read.go
index 0edf501a8..ba21298ba 100644
--- a/weed/server/filer_server_handlers_read.go
+++ b/weed/server/filer_server_handlers_read.go
@@ -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
}