Skip to content

Commit

Permalink
🔨 fix quake hostname is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
wjlin0 committed Jan 26, 2024
1 parent 84485d9 commit 64a5260
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sources/agent/quake/quake.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,12 @@ func (agent *Agent) query(URL string, session *sources.Session, quakeRequest *Re
for _, quakeResult := range quakeResponse.Data {
result := sources.Result{Source: agent.Name()}
result.IP = quakeResult.IP
result.Port = quakeResult.Port
if result.Port = quakeResult.Port; result.Port == 0 {
result.Port = 80
}
host := quakeResult.Hostname
if host == "" {
host = quakeResult.Domain
host = fmt.Sprintf("%s:%d", result.IP, result.Port)
}
result.Host = host
raw, _ := json.Marshal(result)
Expand Down

0 comments on commit 64a5260

Please sign in to comment.