From c9bdd0344d6c7d4b2350edae79cdba6f72575d18 Mon Sep 17 00:00:00 2001 From: Midcoastal Date: Tue, 15 Aug 2023 23:10:30 -0400 Subject: [PATCH] Allow JPEG image files JPEG is allowed and searched for when looking for previews/thumbs, and therefore should be allowed to view. --- modules/ui_extra_networks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ui_extra_networks.py b/modules/ui_extra_networks.py index 75d3a7e23..20c2a2111 100644 --- a/modules/ui_extra_networks.py +++ b/modules/ui_extra_networks.py @@ -34,7 +34,7 @@ def fetch_file(filename: str = ""): return FileResponse(filename, headers={"Accept-Ranges": "bytes"}) if not any(Path(x).absolute() in Path(filename).absolute().parents for x in allowed_dirs): return JSONResponse({"error": f"File cannot be fetched: {filename}. Must be in one of directories registered by extra pages."}) - if os.path.splitext(filename)[1].lower() not in (".png", ".jpg", ".webp"): + if os.path.splitext(filename)[1].lower() not in (".png", ".jpg", ".jpeg", ".webp"): return JSONResponse({"error": f"File cannot be fetched: {filename}. Only png and jpg and webp."}) return FileResponse(filename, headers={"Accept-Ranges": "bytes"})