- Improve propfind handler

- remove path escapes in fileinfo
- other minor fixes
This commit is contained in:
Mukhtar Akere
2025-05-12 03:35:40 +01:00
parent ffb1745bf6
commit 9de7cfd73b
11 changed files with 160 additions and 88 deletions

View File

@@ -1,17 +1,17 @@
package utils
import "strings"
import (
"net/url"
"strings"
)
func EscapePath(path string) string {
// escape %
escapedPath := strings.ReplaceAll(path, "%", "%25")
func PathUnescape(path string) string {
// add others
// try to use url.PathUnescape
if unescaped, err := url.PathUnescape(path); err == nil {
return unescaped
}
return escapedPath
}
func UnescapePath(path string) string {
// unescape %
unescapedPath := strings.ReplaceAll(path, "%25", "%")