Avoid useless check.
This commit is contained in:
@@ -97,13 +97,9 @@ async def preview(req, path):
|
|||||||
quality = int(req.args.get("q", 60))
|
quality = int(req.args.get("q", 60))
|
||||||
rel = PurePosixPath(sanitize(unquote(path)))
|
rel = PurePosixPath(sanitize(unquote(path)))
|
||||||
filepath = config.config.path / rel
|
filepath = config.config.path / rel
|
||||||
if not filepath.is_file():
|
|
||||||
raise NotFound()
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
stat = filepath.lstat()
|
stat = filepath.lstat()
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
# File disappeared between existence check and stat.
|
|
||||||
raise NotFound() from None
|
raise NotFound() from None
|
||||||
|
|
||||||
etag = config.derived_secret(
|
etag = config.derived_secret(
|
||||||
|
|||||||
Reference in New Issue
Block a user