mirror of
https://github.com/pldubouilh/gossa
synced 2025-12-06 08:22:32 +01:00
case insensitive indexing
This commit is contained in:
parent
b2e0396cf1
commit
be39e6aca8
1 changed files with 2 additions and 0 deletions
|
|
@ -14,6 +14,7 @@ import (
|
||||||
"net/url"
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"sort"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
@ -79,6 +80,7 @@ func humanize(bytes int64) string {
|
||||||
func replyList(w http.ResponseWriter, fullPath string, path string) {
|
func replyList(w http.ResponseWriter, fullPath string, path string) {
|
||||||
_files, err := ioutil.ReadDir(fullPath)
|
_files, err := ioutil.ReadDir(fullPath)
|
||||||
check(err)
|
check(err)
|
||||||
|
sort.Slice(_files, func(i, j int) bool { return strings.ToLower(_files[i].Name()) < strings.ToLower(_files[j].Name()) })
|
||||||
|
|
||||||
if !strings.HasSuffix(path, "/") {
|
if !strings.HasSuffix(path, "/") {
|
||||||
path += "/"
|
path += "/"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue