Skip to content

Commit

Permalink
TruncateURLPath: Use previous segment if path ends with a slash
Browse files Browse the repository at this point in the history
  • Loading branch information
iBug committed Sep 7, 2024
1 parent e16a63f commit 6514667
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/analyze/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,9 @@ func TruncateURLPath(input string) string {
return input
}
parts := strings.Split(input, "/")
if parts[len(parts)-1] == "" {
count--
parts[count] += "/"
}
return fmt.Sprintf("/%s/.../%s", parts[1], parts[count])
}

0 comments on commit 6514667

Please sign in to comment.