From b2e2b11ef2146afd5d444cf22c752843f93588cf Mon Sep 17 00:00:00 2001 From: gorkem-bwl Date: Wed, 4 Mar 2026 15:41:01 -0500 Subject: [PATCH] fix: support IPv6 addresses in ping monitor ## Changes - Fixed ping host sanitization regex that stripped everything after the first colon, which destroyed IPv6 addresses like 2001:db8::1 - New regex properly handles bracketed IPv6 ([::1]:port), bare IPv6, and IPv4/hostname:port formats separately ## Closes Fixes #3053 --- server/src/service/infrastructure/networkService.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/src/service/infrastructure/networkService.ts b/server/src/service/infrastructure/networkService.ts index 702affed2..fe770bd0e 100644 --- a/server/src/service/infrastructure/networkService.ts +++ b/server/src/service/infrastructure/networkService.ts @@ -261,7 +261,8 @@ class NetworkService implements INetworkService { const sanitizedHost = rawUrl .replace(/^https?:\/\//, "") .replace(/\/.*$/, "") - .replace(/:.*/, ""); + .replace(/^\[(.+)\](?::.*)?$/, "$1") // Extract IPv6 from brackets, strip port + .replace(/^([^[\]:]+):(\d+)$/, "$1"); // Strip port from IPv4/hostname only const { response, error } = await this.timeRequest(() => this.ping.promise.probe(sanitizedHost)); if (!response) {