From c38d1281d4119c6592eb3a1b8a605c4e38e6b282 Mon Sep 17 00:00:00 2001 From: Mark Rachapoom Date: Fri, 20 Mar 2026 19:26:09 -0700 Subject: [PATCH] fix: send Origin header in gateway WebSocket connections The Node.js ws library doesn't send an Origin header by default. When the client identifies as openclaw-control-ui, the gateway enforces origin checks and rejects connections with missing origin. Pass the gateway URL as the Origin header so the gateway's local-loopback check sees a valid loopback origin and allows it. Bump to v2.3.20. Made-with: Cursor --- apps/web/lib/agent-runner.ts | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/web/lib/agent-runner.ts b/apps/web/lib/agent-runner.ts index 7a2a0ffec97..93b4b429a58 100644 --- a/apps/web/lib/agent-runner.ts +++ b/apps/web/lib/agent-runner.ts @@ -556,7 +556,7 @@ class GatewayWsClient { if (this.ws) { return; } - const ws = new NodeWebSocket(this.settings.url); + const ws = new NodeWebSocket(this.settings.url, { origin: this.settings.url }); this.ws = ws; // Attach message/close handlers BEFORE awaiting "open" so that diff --git a/package.json b/package.json index 50898f82e65..7c62aac5359 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "denchclaw", - "version": "2.3.19", + "version": "2.3.20", "description": "Fully Managed OpenClaw Framework for managing your CRM, Sales Automation and Outreach agents. The only local productivity tool you need.", "keywords": [], "homepage": "https://github.com/DenchHQ/DenchClaw#readme",