mirror of
https://github.com/projectdiscovery/subfinder
synced 2026-06-21 14:05:24 +00:00
c1ce78eac9
Two bugs in rate limit handling: 1. Global -rl flag was ignored for sources without a per-source override. Only sources explicitly listed in -rls got rate-limited; all others ran unlimited, defeating the purpose of -rl. 2. Per-source duration from -rls (e.g. hackertarget=2/m) was silently dropped. runner.go stored MaxCount but discarded Duration, so all sources defaulted to per-second regardless of the /m or /s suffix. Root cause: runner.go converted goflags.RateLimitMap → CustomRateLimit but only copied MaxCount. buildMultiRateLimiter only checked per-source limits, never falling back to the global rate. Changes: - Add CustomDuration field to CustomRateLimit struct - Store both MaxCount and Duration from -rls in runner.go - Add resolveSourceRateLimit() with clear priority: per-source > global > unlimited - Guard against nil rateLimit in buildMultiRateLimiter - Add 9 unit tests covering all combinations Fixes #1434