Merge pull request #7535 from mcmonkey4eva/fix-symlink-extra-network

fix symlinks in extra networks ui
This commit is contained in:
AUTOMATIC1111 2023-02-05 11:28:30 +03:00 committed by GitHub
commit 3993aa43e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,7 +26,7 @@ def add_pages_to_demo(app):
def fetch_file(filename: str = ""):
from starlette.responses import FileResponse
if not any([Path(x).resolve() in Path(filename).resolve().parents for x in allowed_dirs]):
if not any([Path(x).absolute() in Path(filename).absolute().parents for x in allowed_dirs]):
raise ValueError(f"File cannot be fetched: {filename}. Must be in one of directories registered by extra pages.")
ext = os.path.splitext(filename)[1].lower()