Skip to content

Commit

Permalink
[release] v0.16.0-unstable62
Browse files Browse the repository at this point in the history
  • Loading branch information
azukaar committed Sep 21, 2024
1 parent 46fe9da commit b8f6776
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cosmos-server",
"version": "0.16.0-unstable61",
"version": "0.16.0-unstable62",
"description": "",
"main": "test-server.js",
"bugs": {
Expand Down
9 changes: 5 additions & 4 deletions src/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -547,8 +550,6 @@ func GetAllHostnames(applyWildCard bool, removePorts bool) []string {
}
}

Debug("All Hostnames: " + fmt.Sprint(uniqueHostnames))

return uniqueHostnames
}

Expand Down

0 comments on commit b8f6776

Please sign in to comment.