Skip to content

Commit

Permalink
Merge pull request #1529 from thurrsense/dev
Browse files Browse the repository at this point in the history
FIX: query for downloading subdomains in netlas.go
  • Loading branch information
dogancanbakir authored Feb 25, 2025
2 parents 3064274 + 6cbfed9 commit 5da6dad
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions v2/pkg/subscraping/sources/netlas/netlas.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ func (s *Source) Run(ctx context.Context, domain string, session *subscraping.Se
// Make a single POST request to get all domains via download method

apiUrl := "https://app.netlas.io/api/domains/download/"
query := fmt.Sprintf("domain:(domain:*.%s AND NOT domain:%s)", domain, domain)
query := fmt.Sprintf("domain:*.%s AND NOT domain:%s", domain, domain)
requestBody := map[string]interface{}{
"q": query,
"fields": []string{"*"},
"q": query,
"fields": []string{"*"},
"source_type": "include",
"size": domainsCount.Count,
}
Expand All @@ -116,8 +116,8 @@ func (s *Source) Run(ctx context.Context, domain string, session *subscraping.Se
randomApiKey = subscraping.PickRandom(s.apiKeys, s.Name())

resp, err = session.HTTPRequest(ctx, http.MethodPost, apiUrl, "", map[string]string{
"accept": "application/json",
"X-API-Key": randomApiKey,
"accept": "application/json",
"X-API-Key": randomApiKey,
"Content-Type": "application/json"}, strings.NewReader(string(jsonRequestBody)), subscraping.BasicAuth{})
if err != nil {
results <- subscraping.Result{Source: s.Name(), Type: subscraping.Error, Error: err}
Expand Down

0 comments on commit 5da6dad

Please sign in to comment.