Skip to content

Commit

Permalink
Merge pull request #361 from xuchaoa/fix_wildcard
Browse files Browse the repository at this point in the history
Fixed wildcard validation for resolver module
  • Loading branch information
Ice3man543 authored Jan 15, 2021
2 parents 2402821 + 488a89c commit 615d480
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions v2/pkg/resolve/resolve.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,18 @@ func (r *ResolutionPool) resolveWorker() {
continue
}

var skip bool
for _, host := range hosts {
// Ignore the host if it exists in wildcard ips map
if _, ok := r.wildcardIPs[host]; ok { //nolint:staticcheck //search alternatives for "comma ok"
continue
skip = true
break
}
}

r.Results <- Result{Type: Subdomain, Host: task.Host, IP: hosts[0], Source: task.Source}
if !skip {
r.Results <- Result{Type: Subdomain, Host: task.Host, IP: hosts[0], Source: task.Source}
}
}
r.wg.Done()
}
Expand Down

0 comments on commit 615d480

Please sign in to comment.