mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-18 16:45:28 +00:00
Merge pull request #4884 from kiokuless/fix-rate-limiter
Fix overriding the predefined ratelimiter by WithGlobalRateLimit
This commit is contained in:
commit
aaf3cf9cb3
@ -186,6 +186,7 @@ func (e *NucleiEngine) init() error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if e.executerOpts.RateLimiter == nil {
|
||||||
if e.opts.RateLimitMinute > 0 {
|
if e.opts.RateLimitMinute > 0 {
|
||||||
e.executerOpts.RateLimiter = ratelimit.New(context.Background(), uint(e.opts.RateLimitMinute), time.Minute)
|
e.executerOpts.RateLimiter = ratelimit.New(context.Background(), uint(e.opts.RateLimitMinute), time.Minute)
|
||||||
} else if e.opts.RateLimit > 0 {
|
} else if e.opts.RateLimit > 0 {
|
||||||
@ -193,6 +194,7 @@ func (e *NucleiEngine) init() error {
|
|||||||
} else {
|
} else {
|
||||||
e.executerOpts.RateLimiter = ratelimit.NewUnlimited(context.Background())
|
e.executerOpts.RateLimiter = ratelimit.NewUnlimited(context.Background())
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
e.engine = core.New(e.opts)
|
e.engine = core.New(e.opts)
|
||||||
e.engine.SetExecuterOptions(e.executerOpts)
|
e.engine.SetExecuterOptions(e.executerOpts)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user