fix: avoid panic on short hash
(caught higher up but should still be fixed)
Steven Allen committed
Jul 30, 2021 at 11:33 UTC
0858dc62aa7303c0da67289eee590013730c631b
1 file changed
+3
core/corehttp/gateway_indexPage.go
+3
@@ -75,6 +75,9 @@ func breadcrumbs(urlPath string, dnslinkOrigin bool) []breadcrumb {
75
}
76
77
func shortHash(hash string) string {
78
+ if len(hash) <= 8 {
79
+ return hash
80
+ }
81
return (hash[0:4] + "\u2026" + hash[len(hash)-4:])
82
}
83