mirror of
https://github.com/woodchen-ink/proxy-go.git
synced 2025-07-18 08:31:55 +08:00
状态码统计数组越界
This commit is contained in:
parent
864ebcc610
commit
ba691431f4
@ -292,9 +292,10 @@ func (c *Collector) GetStats() map[string]interface{} {
|
||||
|
||||
// 状态码统计
|
||||
statusStats := make(map[string]int64)
|
||||
statusGroups := []string{"1xx", "2xx", "3xx", "4xx", "5xx"}
|
||||
for i := range c.statusStats {
|
||||
statusStats[statusGroups[i]] = c.statusStats[i].Load()
|
||||
if i < len(c.statusStats) {
|
||||
statusStats[fmt.Sprintf("%dxx", i+1)] = c.statusStats[i].Load()
|
||||
}
|
||||
}
|
||||
stats["status_code_stats"] = statusStats
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user