wrap up url escape bug; fix pausedUP bug

This commit is contained in:
Mukhtar Akere
2025-04-17 19:12:28 +01:00
parent 8c78da3f69
commit f34a371274
5 changed files with 12 additions and 8 deletions

View File

@@ -14,6 +14,7 @@ import (
"io"
"net/http"
"net/http/httptest"
"net/url"
"os"
path "path/filepath"
"slices"
@@ -465,6 +466,13 @@ func (h *Handler) serveDirectory(w http.ResponseWriter, r *http.Request, file we
"add": func(a, b int) int {
return a + b
},
"urlpath": func(p string) string {
segments := strings.Split(p, "/")
for i, segment := range segments {
segments[i] = url.PathEscape(segment)
}
return strings.Join(segments, "/")
},
"formatSize": func(bytes int64) string {
const (
KB = 1024