From 72bb4b8865349a9c127c0cfe45eff7608b338303 Mon Sep 17 00:00:00 2001 From: henryruhs Date: Sat, 20 Dec 2025 18:47:38 +0100 Subject: [PATCH] POC for API --- facefusion/apis/version.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/facefusion/apis/version.py b/facefusion/apis/version.py index 20a6ae83..842fed0c 100644 --- a/facefusion/apis/version.py +++ b/facefusion/apis/version.py @@ -46,6 +46,11 @@ def check_version_match_websocket(websocket : WebSocket) -> Optional[str]: async def version_guard_middleware(scope : Scope, receive : Receive, send : Send, app : ASGIApp) -> None: if scope['type'] == 'http': + # Skip version check for OPTIONS requests (CORS preflight) + if scope.get('method') == 'OPTIONS': + await app(scope, receive, send) + return + headers = Headers(scope = scope) client_version = headers.get('X-API-Version') server_version = get_api_version()