From 8aadbc5a9a1c6f79f66d95e5a534f2ebf8c9d657 Mon Sep 17 00:00:00 2001 From: SergBobrovsky Date: Sun, 3 Jan 2021 17:46:37 +0300 Subject: [PATCH] remove redundunt check in static_file() --- bottle.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bottle.py b/bottle.py index 23fff762..57f0e392 100755 --- a/bottle.py +++ b/bottle.py @@ -2883,7 +2883,7 @@ def static_file(filename, root, if not filename.startswith(root): return HTTPError(403, "Access denied.") - if not os.path.exists(filename) or not os.path.isfile(filename): + if not os.path.isfile(filename): return HTTPError(404, "File does not exist.") if not os.access(filename, os.R_OK): return HTTPError(403, "You do not have permission to access this file.")