API: Improved the rate limit parser

This commit is contained in:
diamondburned 2020-02-07 08:37:01 -08:00
parent f3b4362ada
commit ce752a0230
1 changed files with 5 additions and 1 deletions

View File

@ -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] = ""