mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2026-01-31 07:43:09 +08:00
Merge pull request #5972 from meme-lord/multioptions
allow WithNetworkConfig and WithInteractshOptions to be used by NewThreadSafeNucleiEngineCtx
This commit is contained in:
@@ -102,7 +102,8 @@ type InteractshOpts interactsh.Options
|
||||
// WithInteractshOptions sets interactsh options
|
||||
func WithInteractshOptions(opts InteractshOpts) NucleiSDKOptions {
|
||||
return func(e *NucleiEngine) error {
|
||||
if e.mode == threadSafe {
|
||||
// WithInteractshOptions can be used when creating ThreadSafeNucleiEngine but not after it's initialized
|
||||
if e.mode == threadSafe && e.interactshOpts != nil {
|
||||
return errkit.Wrap(ErrOptionsNotSupported, "WithInteractshOptions")
|
||||
}
|
||||
optsPtr := &opts
|
||||
@@ -284,7 +285,8 @@ type NetworkConfig struct {
|
||||
// WithNetworkConfig allows setting network config options
|
||||
func WithNetworkConfig(opts NetworkConfig) NucleiSDKOptions {
|
||||
return func(e *NucleiEngine) error {
|
||||
if e.mode == threadSafe {
|
||||
// WithNetworkConfig can be used when creating ThreadSafeNucleiEngine but not after it's initialized
|
||||
if e.mode == threadSafe && e.hostErrCache != nil {
|
||||
return errkit.Wrap(ErrOptionsNotSupported, "WithNetworkConfig")
|
||||
}
|
||||
e.opts.NoHostErrors = opts.DisableMaxHostErr
|
||||
|
||||
Reference in New Issue
Block a user