Skip to content

allow WithNetworkConfig and WithInteractshOptions to be used by NewThreadSafeNucleiEngineCtx #5972

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,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 ErrOptionsNotSupported.Msgf("WithInteractshOptions")
}
optsPtr := &opts
Expand Down Expand Up @@ -283,7 +284,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 ErrOptionsNotSupported.Msgf("WithNetworkConfig")
}
e.opts.Timeout = opts.Timeout
Expand Down
Loading