From a45e4bbd19b45d3154c8c11ebaf645d3a34c0ebd Mon Sep 17 00:00:00 2001 From: Dogan Can Bakir <65292895+dogancanbakir@users.noreply.github.com> Date: Thu, 12 Sep 2024 14:35:32 +0300 Subject: [PATCH] move code around (#5626) --- lib/sdk_private.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/sdk_private.go b/lib/sdk_private.go index b65ecf2a2..cacd9a1ca 100644 --- a/lib/sdk_private.go +++ b/lib/sdk_private.go @@ -108,14 +108,6 @@ func (e *NucleiEngine) init(ctx context.Context) error { return err } - if e.opts.ProxyInternal && types.ProxyURL != "" || types.ProxySocksURL != "" { - httpclient, err := httpclientpool.Get(e.opts, &httpclientpool.Configuration{}) - if err != nil { - return err - } - e.httpClient = httpclient - } - e.parser = templates.NewParser() if sharedInit == nil || protocolstate.ShouldInit() { @@ -126,6 +118,14 @@ func (e *NucleiEngine) init(ctx context.Context) error { _ = protocolinit.Init(e.opts) }) + if e.opts.ProxyInternal && types.ProxyURL != "" || types.ProxySocksURL != "" { + httpclient, err := httpclientpool.Get(e.opts, &httpclientpool.Configuration{}) + if err != nil { + return err + } + e.httpClient = httpclient + } + e.applyRequiredDefaults(ctx) var err error