Browse Source
Merge pull request #1091 from divinerapier/fix/abused-404
fix abused 404 status code
pull/1096/head
Chris Lu
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
9 additions and
4 deletions
-
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) |
|
|
fs.listDirectoryHandler(w, r) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
if err == filer2.ErrNotFound { |
|
|
glog.V(1).Infof("Not found %s: %v", path, err) |
|
|
glog.V(1).Infof("Not found %s: %v", path, err) |
|
|
|
|
|
|
|
|
stats.FilerRequestCounter.WithLabelValues("read.notfound").Inc() |
|
|
stats.FilerRequestCounter.WithLabelValues("read.notfound").Inc() |
|
|
w.WriteHeader(http.StatusNotFound) |
|
|
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 |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|