- Fix url escape for webdav files

- Add support for bind address, url base
This commit is contained in:
Mukhtar Akere
2025-04-17 15:26:58 +01:00
parent b5b6f0ff73
commit 80615e06d1
10 changed files with 115 additions and 50 deletions

View File

@@ -14,7 +14,6 @@ import (
"io"
"net/http"
"net/http/httptest"
"net/url"
"os"
path "path/filepath"
"slices"
@@ -466,13 +465,6 @@ 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