From b05de96569b67affad2956f0ce7a326ae6796e77 Mon Sep 17 00:00:00 2001 From: Alex Blank Date: Mon, 1 Jun 2026 00:03:33 +0200 Subject: [PATCH] fix: add trailing slash to workspace API URLs FastAPI auto-redirects /workspaces to /workspaces/ with 307. Behind Traefik (HTTP internal), the 307 becomes http://, triggering Mixed Content in the browser. Adding trailing slashes avoids the redirect entirely. --- apps/web/src/api/workspaces.ts | 2 +- docker-compose.yml | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/apps/web/src/api/workspaces.ts b/apps/web/src/api/workspaces.ts index 1632770..d72fc78 100644 --- a/apps/web/src/api/workspaces.ts +++ b/apps/web/src/api/workspaces.ts @@ -9,7 +9,7 @@ import type { function workspaceUrl(projectId: string, repoId: string, workspaceId?: string) { const base = `/projects/${projectId}/repositories/${repoId}/workspaces`; - return workspaceId ? `${base}/${workspaceId}` : base; + return workspaceId ? `${base}/${workspaceId}/` : `${base}/`; } export async function listWorkspaces( diff --git a/docker-compose.yml b/docker-compose.yml index 67bfff3..62f963d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,4 @@ -version: '3.8' +version: "3.8" services: # PostgreSQL Database @@ -14,7 +14,11 @@ services: ports: - "5432:5432" healthcheck: - test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-headquarter} -d ${POSTGRES_DB:-headquarter}"] + test: + [ + "CMD-SHELL", + "pg_isready -U ${POSTGRES_USER:-headquarter} -d ${POSTGRES_DB:-headquarter}", + ] interval: 10s timeout: 5s retries: 5 @@ -76,10 +80,12 @@ services: context: ./apps/web dockerfile: Dockerfile args: - VITE_API_BASE_URL: http://localhost:8000 + VITE_API_BASE_URL: ${VITE_API_BASE_URL:-http://localhost:8000} + VITE_APP_URL: ${VITE_APP_URL:-http://localhost:3000} container_name: hq-web environment: - VITE_API_BASE_URL: http://localhost:8000 + # These are only for documentation; Vite bakes values at build time. + VITE_API_BASE_URL: ${VITE_API_BASE_URL:-http://localhost:8000} ports: - "3000:80" depends_on: