Skip to content

Commit

Permalink
get given domain on resultcallback fx (#800)
Browse files Browse the repository at this point in the history
Co-authored-by: Sandeep Singh <sandeep@projectdiscovery.io>
  • Loading branch information
dogancanbakir and ehsandeep authored Mar 31, 2023
1 parent 2ced65c commit 5075ae3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions v2/pkg/resolve/resolve.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type ResolutionPool struct {

// HostEntry defines a host with the source
type HostEntry struct {
Domain string
Host string
Source string
}
Expand Down
2 changes: 1 addition & 1 deletion v2/pkg/runner/enumerate.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (r *Runner) EnumerateSingleDomainWithCtx(ctx context.Context, domain string
continue
}

hostEntry := resolve.HostEntry{Host: subdomain, Source: result.Source}
hostEntry := resolve.HostEntry{Domain: domain, Host: subdomain, Source: result.Source}

uniqueMap[subdomain] = hostEntry
// If the user asked to remove wildcard then send on the resolve
Expand Down
2 changes: 1 addition & 1 deletion v2/pkg/runner/outputter.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func writeJSONHostIP(input string, results map[string]resolve.Result, writer io.
func (o *OutputWriter) WriteHostNoWildcard(input string, results map[string]resolve.Result, writer io.Writer) error {
hosts := make(map[string]resolve.HostEntry)
for host, result := range results {
hosts[host] = resolve.HostEntry{Host: result.Host, Source: result.Source}
hosts[host] = resolve.HostEntry{Domain: host, Host: result.Host, Source: result.Source}
}

return o.WriteHost(input, hosts, writer)
Expand Down

0 comments on commit 5075ae3

Please sign in to comment.