From 2b4760adfa83084e315da87cfc5231801565ebce Mon Sep 17 00:00:00 2001 From: shenlan Date: Tue, 14 Oct 2025 20:06:22 +0800 Subject: [PATCH] Force internal server proxy to loopback (#521) --- ui/homepage/lib/serviceConfig.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ui/homepage/lib/serviceConfig.ts b/ui/homepage/lib/serviceConfig.ts index b63000c..86ec892 100644 --- a/ui/homepage/lib/serviceConfig.ts +++ b/ui/homepage/lib/serviceConfig.ts @@ -217,7 +217,15 @@ export function getInternalServerServiceBaseUrl(): string { try { const parsed = new URL(external) if (LOCAL_HOSTNAMES.has(parsed.hostname)) { - return normalizeBaseUrl(external) + if (parsed.hostname !== '127.0.0.1') { + parsed.hostname = '127.0.0.1' + } + + if (parsed.protocol === 'https:') { + parsed.protocol = 'http:' + } + + return normalizeBaseUrl(parsed.toString()) } } catch { // Ignore parsing errors and fall back to the internal default below.