Skip to content

Commit

Permalink
fix: avoid panic on short hash
Browse files Browse the repository at this point in the history
(caught higher up but should still be fixed)
  • Loading branch information
Stebalien committed Jul 30, 2021
1 parent cab67f6 commit 0858dc6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/corehttp/gateway_indexPage.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ func breadcrumbs(urlPath string, dnslinkOrigin bool) []breadcrumb {
}

func shortHash(hash string) string {
if len(hash) <= 8 {
return hash
}
return (hash[0:4] + "\u2026" + hash[len(hash)-4:])
}

Expand Down

0 comments on commit 0858dc6

Please sign in to comment.