Skip to content

Commit

Permalink
remove scheme (#1166)
Browse files Browse the repository at this point in the history
* remove scheme

* use replacer

---------

Co-authored-by: Sandeep Singh <sandeep@projectdiscovery.io>
  • Loading branch information
dogancanbakir and ehsandeep committed Mar 26, 2024
1 parent e8cb3d9 commit e5ee088
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion v2/pkg/runner/enumerate.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ import (

const maxNumCount = 2

var replacer = strings.NewReplacer(
"*.", "",
"http://", "",
"https://", "",
)

// EnumerateSingleDomain wraps EnumerateSingleDomainWithCtx with an empty context
func (r *Runner) EnumerateSingleDomain(domain string, writers []io.Writer) error {
return r.EnumerateSingleDomainWithCtx(context.Background(), domain, writers)
Expand Down Expand Up @@ -62,7 +68,7 @@ func (r *Runner) EnumerateSingleDomainWithCtx(ctx context.Context, domain string
skippedCounts[result.Source]++
continue
}
subdomain := strings.ReplaceAll(strings.ToLower(result.Value), "*.", "")
subdomain := replacer.Replace(result.Value)

if matchSubdomain := r.filterAndMatchSubdomain(subdomain); matchSubdomain {
if _, ok := uniqueMap[subdomain]; !ok {
Expand Down

0 comments on commit e5ee088

Please sign in to comment.