From 24badc39d79e15b9ca829516d951d2b7430819c9 Mon Sep 17 00:00:00 2001 From: Jeppe Bundgaard Date: Wed, 1 Jul 2026 11:02:26 +0200 Subject: [PATCH] Keep broker path in API CI public URL --- .github/workflows/tests.yml | 2 +- scripts/edge-gateway-e2e.mjs | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1885f356..2e50dd62 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -228,7 +228,7 @@ jobs: set -euo pipefail cp .github/ci.env .env cp .github/ci.env.staging .env.staging - printf '\nEDGE_PUBLIC_BROKER_URL=http://localhost:%s\n' "$EDGE_BROKER_CI_PORT" >> .env + printf '\nEDGE_PUBLIC_BROKER_URL=http://localhost:%s/edge-broker\n' "$EDGE_BROKER_CI_PORT" >> .env - name: Setup Node.js uses: actions/setup-node@v4 diff --git a/scripts/edge-gateway-e2e.mjs b/scripts/edge-gateway-e2e.mjs index 3dea4055..2907937c 100644 --- a/scripts/edge-gateway-e2e.mjs +++ b/scripts/edge-gateway-e2e.mjs @@ -117,6 +117,10 @@ function resolveBrokerWebSocketUrl(rawUrl, apiBaseUrl) { websocketUrl.pathname = `/api/edge-broker${brokerPath}`; } + if (isLocalHost(websocketUrl.hostname)) { + websocketUrl.pathname = websocketUrl.pathname.replace(/^\/edge-broker(?=\/|$)/, "") || "/"; + } + return websocketUrl.toString(); }