From 7ca86c19fd4369b36778082a28d1e728223d4bef Mon Sep 17 00:00:00 2001 From: Seednode Date: Tue, 20 Jun 2023 09:02:13 -0500 Subject: [PATCH] Added strings.ToLower() to all stable sorts to ensure intuitive ordering --- cmd/root.go | 2 +- cmd/web.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index 9cdf620..4c4143a 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -11,7 +11,7 @@ import ( ) const ( - Version string = "0.52.1" + Version string = "0.52.2" ) var ( diff --git a/cmd/web.go b/cmd/web.go index a475b1f..b93051a 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -258,7 +258,7 @@ func (s *ServeStats) ListImages() ([]byte, error) { stats := s.toExported() sort.SliceStable(stats.List, func(p, q int) bool { - return stats.List[p] < stats.List[q] + return strings.ToLower(stats.List[p]) < strings.ToLower(stats.List[q]) }) a := make([]timesServed, len(stats.List)) @@ -718,7 +718,7 @@ func serveDebugJson(args []string, index *Index) httprouter.Handle { indexDump := index.Index() sort.SliceStable(indexDump, func(p, q int) bool { - return indexDump[p] < indexDump[q] + return strings.ToLower(indexDump[p]) < strings.ToLower(indexDump[q]) }) response, err := json.MarshalIndent(indexDump, "", " ")