URL-decode path from API

This commit is contained in:
TobTobXX 2024-09-02 19:27:25 +02:00
parent d043997d30
commit af4f8fa2ac
No known key found for this signature in database
GPG Key ID: 296BD5C23B2F830E

View File

@ -4,6 +4,7 @@ import re
import uuid
import glob
import shutil
import urllib
from aiohttp import web
from comfy.cli_args import args
from folder_paths import user_directory
@ -139,6 +140,9 @@ class UserManager():
if not file:
return web.Response(status=400)
# Decode URL-encoded file path
file = urllib.parse.unquote(file);
path = self.get_request_user_filepath(request, file)
if not path:
return web.Response(status=403)