move code around (#5626)

This commit is contained in:
Dogan Can Bakir 2024-09-12 14:35:32 +03:00 committed by GitHub
parent 72da91a399
commit a45e4bbd19
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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