mirror of
https://github.com/shadow1ng/fscan.git
synced 2025-09-14 05:56:46 +08:00
fix: 修复目标主机重复显示的问题
- 解决updateGlobalVariables中主机列表重复追加的逻辑错误 - 当info.Host已有值时不再重复设置解析结果 - 修复容器管理日志中显示"127.0.0.1,127.0.0.1"的问题 - 保持从文件读取主机时的正常功能
This commit is contained in:
parent
c6bfb5f064
commit
792a075172
@ -263,10 +263,10 @@ func updateGlobalVariables(config *parsers.ParsedConfig, info *HostInfo) error {
|
||||
// 更新目标相关全局变量
|
||||
if config.Targets != nil {
|
||||
if len(config.Targets.Hosts) > 0 {
|
||||
// 如果info.Host已经有值,说明解析结果来自info.Host,不需要重复设置
|
||||
// 只有当info.Host为空时才设置(如从文件读取的情况)
|
||||
if info.Host == "" {
|
||||
info.Host = joinStrings(config.Targets.Hosts, ",")
|
||||
} else {
|
||||
info.Host += "," + joinStrings(config.Targets.Hosts, ",")
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user