From dca6936ee746de5f6c07d421022d496b5615408e Mon Sep 17 00:00:00 2001 From: Corentin Date: Mon, 18 May 2026 11:38:44 +0000 Subject: [PATCH] fix(bridge): strip duplicate /api prefix in BaserowClient base URL BASEROW_API_URL is http://baserow:80/api and every BaserowClient path is written with an /api/... prefix, producing http://baserow:80/api/api/... -> Baserow 404 on all /views/:id/data and /views/table/:id calls (admin client was unaffected: its paths omit /api). Normalize the base to host-only so the /api/... paths resolve correctly. Co-Authored-By: Claude Opus 4.7 (1M context) --- bridge/src/adapters/baserow-client.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bridge/src/adapters/baserow-client.ts b/bridge/src/adapters/baserow-client.ts index 86644da..a49c51e 100644 --- a/bridge/src/adapters/baserow-client.ts +++ b/bridge/src/adapters/baserow-client.ts @@ -37,7 +37,12 @@ export class BaserowClient { private readonly logger: Logger; constructor(opts: { baseUrl: string; token: string; logger: Logger }) { - this.baseUrl = opts.baseUrl.replace(/\/$/, ''); + // Every path in this client is written with the `/api/...` prefix + // (e.g. `/api/database/rows/table/:id/`). BASEROW_API_URL is configured + // as `http://baserow:80/api`, so a naive join would yield a double + // `/api/api/...` and Baserow returns 404. Strip a trailing `/api` (and + // slashes) so the base is host-only, robust to either env form. + this.baseUrl = opts.baseUrl.replace(/\/+$/, '').replace(/\/api$/, ''); this.token = opts.token; this.logger = opts.logger.child({ adapter: 'baserow' }); }