mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-17 15:45:27 +00:00
Merge branch 'main' into dev
This commit is contained in:
commit
b0fe565a8b
@ -4,8 +4,10 @@ import (
|
||||
"context"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"github.com/projectdiscovery/nuclei/v3/pkg/input/provider"
|
||||
"github.com/projectdiscovery/nuclei/v3/pkg/output"
|
||||
"github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/contextargs"
|
||||
"github.com/projectdiscovery/nuclei/v3/pkg/scan"
|
||||
"github.com/projectdiscovery/nuclei/v3/pkg/templates"
|
||||
@ -107,6 +109,22 @@ func (e *Engine) executeTemplateWithTargets(ctx context.Context, template *templ
|
||||
|
||||
// Skip if the host has had errors
|
||||
if e.executerOpts.HostErrorsCache != nil && e.executerOpts.HostErrorsCache.Check(e.executerOpts.ProtocolType.String(), contextargs.NewWithMetaInput(ctx, scannedValue)) {
|
||||
skipEvent := &output.ResultEvent{
|
||||
TemplateID: template.ID,
|
||||
TemplatePath: template.Path,
|
||||
Info: template.Info,
|
||||
Type: e.executerOpts.ProtocolType.String(),
|
||||
Host: scannedValue.Input,
|
||||
MatcherStatus: false,
|
||||
Error: "host was skipped as it was found unresponsive",
|
||||
Timestamp: time.Now(),
|
||||
}
|
||||
|
||||
if e.Callback != nil {
|
||||
e.Callback(skipEvent)
|
||||
} else if e.executerOpts.Output != nil {
|
||||
_ = e.executerOpts.Output.Write(skipEvent)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
@ -54,15 +54,17 @@ type Options struct {
|
||||
|
||||
// New creates a new issue tracker integration client based on options.
|
||||
func New(options *Options) (*Integration, error) {
|
||||
var transport http.RoundTripper = http.DefaultTransport
|
||||
if options.HttpClient != nil && options.HttpClient.HTTPClient.Transport != nil {
|
||||
transport = options.HttpClient.HTTPClient.Transport
|
||||
}
|
||||
|
||||
httpClient := &http.Client{
|
||||
Transport: &addHeaderTransport{
|
||||
T: http.DefaultTransport,
|
||||
T: transport,
|
||||
Key: options.APIKey,
|
||||
},
|
||||
}
|
||||
if options.HttpClient != nil {
|
||||
httpClient.Transport = options.HttpClient.HTTPClient.Transport
|
||||
}
|
||||
|
||||
integration := &Integration{
|
||||
url: "https://api.linear.app/graphql",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user