Files
dify/api/controllers
L1nSn0w 4f2226a879 feat(openapi): reject outdated difyctl clients with HTTP 426
Add an app-level version gate on /openapi/v1 that reads the difyctl version
from the User-Agent and returns 426 Upgrade Required (with an upgrade hint)
when the client is older than MIN_DIFYCTL_VERSION (0.2.0).

Registered via before_app_request so it also fires for requests to removed
paths — those no longer match a route and would otherwise 404 before a
blueprint-scoped hook runs. Allowlists _version/_health and fails open for
non-difyctl or unparseable User-Agents.
2026-07-03 19:22:23 +08:00
..