diff --git a/middleware/browse/browse.go b/middleware/browse/browse.go index d09bd253..9826bf69 100644 --- a/middleware/browse/browse.go +++ b/middleware/browse/browse.go @@ -99,7 +99,10 @@ func (b Browse) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error) { // Load directory contents file, err := os.Open(b.Root + r.URL.Path) if err != nil { - return http.StatusForbidden, err + if os.IsPermission(err) { + return http.StatusForbidden, err + } + return http.StatusNotFound, err } defer file.Close()