fix: skip X-Tenant-Id header when EXPRESS_SERVER_URL points to remote
Docker Build (ARM64) / Build & Push (push) Successful in 2m53s

This commit is contained in:
2026-06-25 01:16:04 +02:00
parent bb710b46b0
commit 40b882672a
+5 -1
View File
@@ -144,9 +144,13 @@ interface SyncResponse {
function canvasHeaders(extra?: Record<string, string>): Record<string, string> {
const headers: Record<string, string> = {
'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;