From b8f67763ba2fe0f3a12fceb50140b32cf53d34a1 Mon Sep 17 00:00:00 2001 From: Yann Stepienik Date: Sat, 21 Sep 2024 15:19:06 +0100 Subject: [PATCH] [release] v0.16.0-unstable62 --- package.json | 2 +- src/utils/utils.go | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index fc6b521f..15c90eb0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cosmos-server", - "version": "0.16.0-unstable61", + "version": "0.16.0-unstable62", "description": "", "main": "test-server.js", "bugs": { diff --git a/src/utils/utils.go b/src/utils/utils.go index 4fee828c..720cf6de 100644 --- a/src/utils/utils.go +++ b/src/utils/utils.go @@ -453,16 +453,19 @@ func RemoveStringFromSlice(slice []string, s string) []string { } func filterHostnamesByWildcard(hostnames []string, wildcards []string) []string { + finalHostnames := make([]string, len(hostnames)) + copy(finalHostnames, hostnames) + for _, wildcard := range wildcards { for _, hostname := range hostnames { if strings.HasSuffix(hostname, wildcard[1:]) && hostname != wildcard[2:] { // remove hostname - hostnames = RemoveStringFromSlice(hostnames, hostname) + finalHostnames = RemoveStringFromSlice(finalHostnames, hostname) } } } - return hostnames + return finalHostnames } func GetAllHostnames(applyWildCard bool, removePorts bool) []string { @@ -547,8 +550,6 @@ func GetAllHostnames(applyWildCard bool, removePorts bool) []string { } } - Debug("All Hostnames: " + fmt.Sprint(uniqueHostnames)) - return uniqueHostnames }