mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2026-01-31 15:53:10 +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
|
// WithInteractshOptions sets interactsh options
|
||||||
func WithInteractshOptions(opts InteractshOpts) NucleiSDKOptions {
|
func WithInteractshOptions(opts InteractshOpts) NucleiSDKOptions {
|
||||||
return func(e *NucleiEngine) error {
|
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")
|
return errkit.Wrap(ErrOptionsNotSupported, "WithInteractshOptions")
|
||||||
}
|
}
|
||||||
optsPtr := &opts
|
optsPtr := &opts
|
||||||
@@ -284,7 +285,8 @@ type NetworkConfig struct {
|
|||||||
// WithNetworkConfig allows setting network config options
|
// WithNetworkConfig allows setting network config options
|
||||||
func WithNetworkConfig(opts NetworkConfig) NucleiSDKOptions {
|
func WithNetworkConfig(opts NetworkConfig) NucleiSDKOptions {
|
||||||
return func(e *NucleiEngine) error {
|
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")
|
return errkit.Wrap(ErrOptionsNotSupported, "WithNetworkConfig")
|
||||||
}
|
}
|
||||||
e.opts.NoHostErrors = opts.DisableMaxHostErr
|
e.opts.NoHostErrors = opts.DisableMaxHostErr
|
||||||
|
|||||||
Reference in New Issue
Block a user