Harden scan robustness and tests

This commit is contained in:
ZacharyZcR
2026-06-14 22:23:48 +08:00
parent 5ad914a1bb
commit c49c23c7f0
100 changed files with 4483 additions and 412 deletions
+7 -4
View File
@@ -200,11 +200,14 @@ func parsePortRange(rangeStr string) []int {
// expandPortGroups 展开端口组
func expandPortGroups(ports string) string {
portGroups := config.GetPortGroups()
result := ports
for group, portList := range portGroups {
result = strings.ReplaceAll(result, group, portList)
parts := strings.Split(ports, ",")
for i, part := range parts {
token := strings.TrimSpace(part)
if portList, ok := portGroups[token]; ok {
parts[i] = portList
}
}
return result
return strings.Join(parts, ",")
}
// =============================================================================