From 40b882672acd749a07c1ec7b54ada7fa2e8d86d3 Mon Sep 17 00:00:00 2001 From: Fork Less Date: Thu, 25 Jun 2026 01:16:04 +0200 Subject: [PATCH] fix: skip X-Tenant-Id header when EXPRESS_SERVER_URL points to remote --- src/index.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index c8aa0a9..ce236de 100644 --- a/src/index.ts +++ b/src/index.ts @@ -144,9 +144,13 @@ interface SyncResponse { function canvasHeaders(extra?: Record): Record { const headers: Record = { 'Content-Type': 'application/json', - 'X-Tenant-Id': dbGetActiveTenantId(), ...extra }; + // Only send tenant header when targeting local canvas (EXPRESS_SERVER_URL unset). + // Remote servers (e.g. production) handle routing via default tenant. + if (!process.env.EXPRESS_SERVER_URL) { + headers['X-Tenant-Id'] = dbGetActiveTenantId(); + } // Forward API key to canvas when auth is enabled — required for two-service // Docker deployments where canvas runs with EXCALIDRAW_API_KEY set. const apiKey = process.env.EXCALIDRAW_API_KEY;