Avoid useless check.

This commit is contained in:
2026-04-24 00:04:58 +00:00
parent fc48500412
commit 0190bda853
-4
View File
@@ -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(