Merge pull request #5972 from meme-lord/multioptions

allow WithNetworkConfig and WithInteractshOptions to be used by NewThreadSafeNucleiEngineCtx
This commit is contained in:
Dogan Can Bakir
2026-01-12 20:07:26 +07:00
committed by GitHub

View File

@@ -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