nuclei/pkg/js/compiler/init.go
Tarun Koyalwar a677fca192
misc improvements in js protocol execution (#4643)
* js protocol  timeout using -timeout flag

* fix zgrab smb hang

* fix lint error

* custom timeout field in js protocol

* minor update: bound checking

* add 6 * -timeout in code protocol by default
2024-01-18 04:39:15 +05:30

21 lines
378 B
Go

package compiler
import "github.com/projectdiscovery/nuclei/v3/pkg/types"
// jsprotocolInit
var (
// Per Execution Javascript timeout in seconds
JsProtocolTimeout = 10
)
// Init initializes the javascript protocol
func Init(opts *types.Options) error {
if opts.Timeout < 10 {
// keep existing 10s timeout
return nil
}
JsProtocolTimeout = opts.Timeout
return nil
}