From f970072f66a8d5fc533656b12a9302500305a516 Mon Sep 17 00:00:00 2001 From: Haoqing Wang <78337154+hqhq1025@users.noreply.github.com> Date: Sun, 5 Apr 2026 12:32:53 +0800 Subject: [PATCH] fix(hub): add PATCH to CORS allowMethods so session rename works (#391) The rename endpoint uses PATCH /api/sessions/:id, but the CORS middleware only allowed GET, POST, DELETE, OPTIONS. Browsers send a preflight OPTIONS request for PATCH; without it in allowMethods the preflight fails and the request never reaches the handler, causing "Failed to rename" in the web UI every time. via [HAPI](https://hapi.run) Co-authored-by: HAPI --- hub/src/web/server.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hub/src/web/server.ts b/hub/src/web/server.ts index 08800fc7..6cb156cc 100644 --- a/hub/src/web/server.ts +++ b/hub/src/web/server.ts @@ -77,7 +77,7 @@ function createWebApp(options: { const corsOriginOption = corsOrigins.includes('*') ? '*' : corsOrigins const corsMiddleware = cors({ origin: corsOriginOption, - allowMethods: ['GET', 'POST', 'DELETE', 'OPTIONS'], + allowMethods: ['GET', 'POST', 'PATCH', 'DELETE', 'OPTIONS'], allowHeaders: ['authorization', 'content-type'] }) app.use('/api/*', corsMiddleware)