From d9871f44d5bf338162a0193216821464fd8e3519 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 11 Feb 2026 02:21:35 +0000 Subject: [PATCH] Fix local network access prompts in multi-site analysis Replace hardcoded http://localhost:5001 fallback with relative /api paths in useSimulationStore.js. The scan/start fetch and task_status SSE connection were bypassing the Nginx/Vite proxy, causing browsers to trigger Private Network Access prompts. https://claude.ai/code/session_01PkyUMCPmh7jUm4BYjeV5dd --- src/store/useSimulationStore.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/store/useSimulationStore.js b/src/store/useSimulationStore.js index ff5fc45..404a6db 100644 --- a/src/store/useSimulationStore.js +++ b/src/store/useSimulationStore.js @@ -50,10 +50,8 @@ const useSimulationStore = create((set, get) => ({ set({ isScanning: true, scanProgress: 0, results: null, compositeOverlay: null, interNodeLinks: null, totalUniqueCoverageKm2: null }); try { - const API_TARGET = import.meta.env.VITE_API_URL || 'http://localhost:5001'; - // 1. Trigger Scan - const response = await fetch(`${API_TARGET}/scan/start`, { + const response = await fetch('/api/scan/start', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ nodes, optimize_n: optimizeN }), @@ -74,8 +72,7 @@ const useSimulationStore = create((set, get) => ({ }, listenToProgress: (taskId) => { - const API_TARGET = import.meta.env.VITE_API_URL || 'http://localhost:5001'; - const eventSource = new EventSource(`${API_TARGET}/task_status/${taskId}`); + const eventSource = new EventSource(`/api/task_status/${taskId}`); eventSource.onmessage = (event) => { let payload;