mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-18 06:15:27 +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,12 +186,14 @@ func (e *NucleiEngine) init() error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if e.opts.RateLimitMinute > 0 {
|
if e.executerOpts.RateLimiter == nil {
|
||||||
e.executerOpts.RateLimiter = ratelimit.New(context.Background(), uint(e.opts.RateLimitMinute), time.Minute)
|
if e.opts.RateLimitMinute > 0 {
|
||||||
} else if e.opts.RateLimit > 0 {
|
e.executerOpts.RateLimiter = ratelimit.New(context.Background(), uint(e.opts.RateLimitMinute), time.Minute)
|
||||||
e.executerOpts.RateLimiter = ratelimit.New(context.Background(), uint(e.opts.RateLimit), time.Second)
|
} else if e.opts.RateLimit > 0 {
|
||||||
} else {
|
e.executerOpts.RateLimiter = ratelimit.New(context.Background(), uint(e.opts.RateLimit), time.Second)
|
||||||
e.executerOpts.RateLimiter = ratelimit.NewUnlimited(context.Background())
|
} else {
|
||||||
|
e.executerOpts.RateLimiter = ratelimit.NewUnlimited(context.Background())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
e.engine = core.New(e.opts)
|
e.engine = core.New(e.opts)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user