mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-23 22:45:26 +00:00
Adding support for timeout in rawhttp
This commit is contained in:
parent
4764a34224
commit
713433026d
@ -111,7 +111,7 @@ func (r *Request) Compile(options *protocols.ExecuterOptions) error {
|
|||||||
r.Raw[i] = strings.ReplaceAll(raw, "\n", "\r\n")
|
r.Raw[i] = strings.ReplaceAll(raw, "\n", "\r\n")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
r.rawhttpClient = httpclientpool.GetRawHTTP()
|
r.rawhttpClient = httpclientpool.GetRawHTTP(options.Options)
|
||||||
}
|
}
|
||||||
if len(r.Matchers) > 0 || len(r.Extractors) > 0 {
|
if len(r.Matchers) > 0 || len(r.Extractors) > 0 {
|
||||||
compiled := &r.Operators
|
compiled := &r.Operators
|
||||||
|
|||||||
@ -79,9 +79,11 @@ func (c *Configuration) Hash() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GetRawHTTP returns the rawhttp request client
|
// GetRawHTTP returns the rawhttp request client
|
||||||
func GetRawHTTP() *rawhttp.Client {
|
func GetRawHTTP(options *types.Options) *rawhttp.Client {
|
||||||
if rawhttpClient == nil {
|
if rawhttpClient == nil {
|
||||||
rawhttpClient = rawhttp.NewClient(rawhttp.DefaultOptions)
|
rawhttpOptions := rawhttp.DefaultOptions
|
||||||
|
rawhttpOptions.Timeout = time.Duration(options.Timeout) * time.Second
|
||||||
|
rawhttpClient = rawhttp.NewClient(rawhttpOptions)
|
||||||
}
|
}
|
||||||
return rawhttpClient
|
return rawhttpClient
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user