Merge pull request #338 from zanllp/fix-path-check

fix path check
pull/340/head
zanllp 2023-07-23 20:41:38 +08:00 committed by GitHub
commit f79d931d22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -165,6 +165,8 @@ def infinite_image_browsing_api(app: FastAPI, **kwargs):
def is_path_trusted(path: str):
if not enable_access_control:
return True
if not os.path.isabs(path):
path = os.path.normpath(os.path.join(os.getcwd(), path))
try:
parent_paths = mem["all_scanned_paths"]
path = os.path.normpath(path)