mirror of
https://github.com/Comfy-Org/ComfyUI-Manager.git
synced 2026-06-13 01:10:19 +08:00
fix: guard against None request in reject_simple_form_post
queue_batch() calls update_comfyui(None) as an internal trigger when
processing an 'update_comfyui' batch item. update_comfyui() passes this
directly to reject_simple_form_post(), which unconditionally accesses
request.content_type, crashing with:
AttributeError: 'NoneType' object has no attribute 'content_type'
This broke the 'Update All' button in the legacy Manager UI.
Fix: return None early when request is None. An internal call with no
request object cannot be a cross-origin form POST, so CSRF gating does
not apply.
Fixes #2880
This commit is contained in:
parent
01799f8cac
commit
d04a3b76af
@ -62,6 +62,8 @@ def reject_simple_form_post(request) -> Optional[web.Response]:
|
|||||||
strips parameters), so a ``multipart/form-data; boundary=----X`` header
|
strips parameters), so a ``multipart/form-data; boundary=----X`` header
|
||||||
is compared as ``multipart/form-data``.
|
is compared as ``multipart/form-data``.
|
||||||
"""
|
"""
|
||||||
|
if request is None:
|
||||||
|
return None
|
||||||
if request.content_type in _SIMPLE_FORM_CONTENT_TYPES:
|
if request.content_type in _SIMPLE_FORM_CONTENT_TYPES:
|
||||||
return web.Response(
|
return web.Response(
|
||||||
status=400,
|
status=400,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user