From 3c04f5cec0f5ce75d46af9a992770578c7fad328 Mon Sep 17 00:00:00 2001 From: Calvin Secrest Date: Fri, 5 Sep 2025 18:47:57 -0400 Subject: [PATCH] fix: preserve API path prefix for EventSource --- frontend/chat-ui/src/components/ChatWindow.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/chat-ui/src/components/ChatWindow.jsx b/frontend/chat-ui/src/components/ChatWindow.jsx index 0dfaccb..ffafc74 100644 --- a/frontend/chat-ui/src/components/ChatWindow.jsx +++ b/frontend/chat-ui/src/components/ChatWindow.jsx @@ -15,7 +15,8 @@ export default function ChatWindow() { useEffect(() => { if (!state.currentConversation) return; const base = API_BASE_URL || window.location.origin; - const url = new URL(`/stream/${state.currentConversation.id}`, base); + const baseUrl = base.endsWith('/') ? base : `${base}/`; + const url = new URL(`stream/${state.currentConversation.id}`, baseUrl); const apiKey = import.meta.env.VITE_API_KEY; if (apiKey) { url.searchParams.set('api_key', apiKey);