mirror of
https://github.com/caddyserver/caddy.git
synced 2025-01-06 22:40:31 -05:00
Check and return the correct error if Stat method fails (see golang issue #12991)
This commit is contained in:
parent
4db54f8ddc
commit
8ecc366582
1 changed files with 2 additions and 2 deletions
|
@ -62,8 +62,8 @@ func (fh *fileHandler) serveFile(w http.ResponseWriter, r *http.Request, name st
|
|||
}
|
||||
defer f.Close()
|
||||
|
||||
d, err1 := f.Stat()
|
||||
if err1 != nil {
|
||||
d, err := f.Stat()
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
return http.StatusNotFound, nil
|
||||
} else if os.IsPermission(err) {
|
||||
|
|
Loading…
Reference in a new issue