diff --git a/cmd/version.go b/cmd/version.go index b6eac66..d104a03 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -10,7 +10,7 @@ import ( "github.com/spf13/cobra" ) -var Version = "0.45.0" +var Version = "0.45.1" func init() { rootCmd.AddCommand(versionCmd) diff --git a/cmd/web.go b/cmd/web.go index 2af808d..a7a48ca 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -561,7 +561,12 @@ func serveDebugHtml(args []string, index *Index) http.HandlerFunc { htmlBody.WriteString(``) htmlBody.WriteString(`Debug`) for _, v := range indexDump { - htmlBody.WriteString(fmt.Sprintf("%s\n", v, v)) + var shouldSort = "" + + if sorting { + shouldSort = "?sort=asc" + } + htmlBody.WriteString(fmt.Sprintf("%s\n", v, shouldSort, v)) } htmlBody.WriteString(``) @@ -672,7 +677,7 @@ func serveStaticFile(paths []string, stats *ServeStats) http.HandlerFunc { } } -func serveImage(paths []string, Regexes *Regexes, index *Index) http.HandlerFunc { +func serveMedia(paths []string, Regexes *Regexes, index *Index) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { refererUri, err := stripQueryParams(refererToUri(r.Referer())) if err != nil { @@ -907,7 +912,7 @@ func ServePage(args []string) error { }() } - http.Handle("/", serveImage(paths, Regexes, index)) + http.Handle("/", serveMedia(paths, Regexes, index)) http.Handle(Prefix+"/", http.StripPrefix(Prefix, serveStaticFile(paths, stats))) http.HandleFunc("/favicon.ico", doNothing)