fix
This commit is contained in:
1 parent
645f923175
commit
2cf2cebf5c
20 files changed
+481
-51
No files matched your search
@@ -346,7 +346,7 @@ func NormalizeRoute(route string) string {
|
||||
if part == "" {
|
||||
continue
|
||||
}
|
||||
if uuidRe.MatchString(part) || hexIDRe.MatchString(part) || numRe.MatchString(part) {
|
||||
if uuidRe.MatchString(part) || hexIDRe.MatchString(part) || numRe.MatchString(part) || prefixedIDRe.MatchString(part) {
|
||||
parts[i] = "{id}"
|
||||
}
|
||||
}
|
||||
@@ -623,6 +623,9 @@ var (
|
||||
hexIDRe = regexp.MustCompile(`(?i)\b[0-9a-f]{8,}\b`)
|
||||
httpStatusRe = regexp.MustCompile(`(?i)\bhttp\s+([1-5]\d{2})\b`)
|
||||
numRe = regexp.MustCompile(`\b\d+\b`)
|
||||
// A route segment that is a short prefix plus a long hex id (term_ab31…,
|
||||
// sess-9f2c…): \b does not fire between "_" and a hex digit, so hexIDRe misses it.
|
||||
prefixedIDRe = regexp.MustCompile(`(?i)^[a-z]{1,12}[_-][0-9a-f]{8,}$`)
|
||||
spaceRe = regexp.MustCompile(`\s+`)
|
||||
)
|
||||
|
||||
|
||||
Reference in new issue
Block a user