From f2db40fa3613359311c59195aa5bcefa0124be09 Mon Sep 17 00:00:00 2001 From: DanielS Date: Wed, 24 Jun 2026 11:00:44 +0200 Subject: [PATCH] fix: resolve client-side connection timeout by stripping internal port 8000 on Supabase URL rewriting --- shop/lib/utils.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/shop/lib/utils.ts b/shop/lib/utils.ts index 3de7a26..de7d5a8 100644 --- a/shop/lib/utils.ts +++ b/shop/lib/utils.ts @@ -20,6 +20,7 @@ export function resolveSupabaseUrl(url: string | undefined): string | undefined if (parsed.hostname === 'supabase-kong' || parsed.hostname === 'kong') { parsed.hostname = window.location.hostname; parsed.protocol = window.location.protocol; + parsed.port = ''; // Port entfernen, da der öffentliche Zugriff über Port 80/443 läuft return parsed.toString().replace(/\/$/, ''); } @@ -30,6 +31,8 @@ export function resolveSupabaseUrl(url: string | undefined): string | undefined } } catch { let resolved = url + .replace('//supabase-kong:8000', `//${window.location.hostname}`) + .replace('//kong:8000', `//${window.location.hostname}`) .replace('//supabase-kong', `//${window.location.hostname}`) .replace('//kong', `//${window.location.hostname}`); if (window.location.protocol === 'https:') {