From 522dd49f3f1fd39756f6ff95bd3e5c6234a531c7 Mon Sep 17 00:00:00 2001 From: Leo Vasanko Date: Fri, 24 Apr 2026 00:04:58 +0000 Subject: [PATCH] Avoid useless check. --- cista/preview.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/cista/preview.py b/cista/preview.py index 7f39598..5793006 100644 --- a/cista/preview.py +++ b/cista/preview.py @@ -97,13 +97,9 @@ async def preview(req, path): quality = int(req.args.get("q", 60)) rel = PurePosixPath(sanitize(unquote(path))) filepath = config.config.path / rel - if not filepath.is_file(): - raise NotFound() - try: stat = filepath.lstat() except FileNotFoundError: - # File disappeared between existence check and stat. raise NotFound() from None etag = config.derived_secret(