feat: HTTP FLOOD Speed Limit

This commit is contained in:
Roi Feng
2025-04-09 21:47:47 -04:00
parent b49c3573bb
commit 4893e95bb7
3 changed files with 34 additions and 2 deletions

View File

@ -39,3 +39,13 @@ func ParseRate(s string) (int64, int64, error) {
}
return int64(limit), int64(seconds), nil
}
func FindMaxRateTime(rateList map[int64]int64) int64 {
maxTimeWindow := int64(0)
for window := range rateList {
if window > maxTimeWindow {
maxTimeWindow = window
}
}
return maxTimeWindow
}