From ce752a023004a856d94c6345dec2d8185ab70f81 Mon Sep 17 00:00:00 2001 From: diamondburned Date: Fri, 7 Feb 2020 08:37:01 -0800 Subject: [PATCH] API: Improved the rate limit parser --- api/rate/majors.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/api/rate/majors.go b/api/rate/majors.go index 6c63548..81c25df 100644 --- a/api/rate/majors.go +++ b/api/rate/majors.go @@ -27,8 +27,12 @@ func ParseBucketKey(path string) string { } } + // We add 1, since this is the string path. The path following this would be + // the actual value, which we check. + skip++ + // we need to remove IDs from these - for ; skip < len(parts); skip++ { + for ; skip < len(parts); skip += 2 { // Check if it's a number: if _, err := strconv.Atoi(parts[skip]); err == nil { parts[skip] = ""