mirror of
https://github.com/Comfy-Org/ComfyUI-Manager.git
synced 2026-07-26 10:07:38 +08:00
chore(release): 4.2.1 — register extension.manager.supports_csrf_post feature flag (#2823)
Lets clients detect CSRF-POST backend support via ComfyUI core's feature_flags instead of parsing version strings. Absence of the flag indicates a Manager version < 4.2.1 that is incompatible with POST-only state-mutation endpoints. Follow-up to #2818; no endpoint or security behavior change.
This commit is contained in:
@@ -6,6 +6,26 @@ from .common import manager_security
|
||||
from comfy.cli_args import args
|
||||
|
||||
|
||||
# Register server-push feature flag so ComfyUI_frontend (and other clients)
|
||||
# can detect CSRF-POST backend capability as a semantic contract (vs version
|
||||
# string parsing). See PR #2818 for context; clients use this flag to decide
|
||||
# whether to invoke POST state-mutation endpoints. Manager versions prior to
|
||||
# 4.2.1 do not set this flag — clients should treat its absence as
|
||||
# 'incompatible with POST-only state-mutation endpoints'.
|
||||
try:
|
||||
from comfy_api import feature_flags as _core_feature_flags
|
||||
_mgr_flags = (
|
||||
_core_feature_flags.SERVER_FEATURE_FLAGS
|
||||
.setdefault('extension', {})
|
||||
.setdefault('manager', {})
|
||||
)
|
||||
_mgr_flags['supports_csrf_post'] = True
|
||||
except ImportError:
|
||||
# Older ComfyUI core without comfy_api.feature_flags module.
|
||||
# Manager functions but clients will not observe the flag.
|
||||
pass
|
||||
|
||||
|
||||
def prestartup():
|
||||
from . import prestartup_script # noqa: F401
|
||||
logging.info('[PRE] ComfyUI-Manager')
|
||||
|
||||
Reference in New Issue
Block a user