mirror of
https://github.com/bluewave-labs/Checkmate.git
synced 2026-05-14 13:38:39 -05:00
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
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user