mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-09-09 02:47:15 +08:00
Returning a 401 error when provided comfy-user does not exists on server side.
This commit is contained in:
parent
7ff5fc84af
commit
2f3c37e578
@ -15,8 +15,8 @@ class AppSettings():
|
|||||||
"comfy.settings.json"
|
"comfy.settings.json"
|
||||||
)
|
)
|
||||||
except KeyError as e:
|
except KeyError as e:
|
||||||
log.error(f"User settings not found.")
|
logging.error("User settings not found.")
|
||||||
raise aiohttp.web.HTTPUnauthorized('User not found') from e
|
raise web.HTTPUnauthorized() from e
|
||||||
if os.path.isfile(file):
|
if os.path.isfile(file):
|
||||||
try:
|
try:
|
||||||
with open(file) as f:
|
with open(file) as f:
|
||||||
@ -36,9 +36,7 @@ class AppSettings():
|
|||||||
def add_routes(self, routes):
|
def add_routes(self, routes):
|
||||||
@routes.get("/settings")
|
@routes.get("/settings")
|
||||||
async def get_settings(request):
|
async def get_settings(request):
|
||||||
|
return web.json_response(self.get_settings(request))
|
||||||
return web.json_response(self.get_settings(request))
|
|
||||||
|
|
||||||
|
|
||||||
@routes.get("/settings/{id}")
|
@routes.get("/settings/{id}")
|
||||||
async def get_setting(request):
|
async def get_setting(request):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user