From 9053880623aa51aebf27942a3d0b4cb9da4b1fa8 Mon Sep 17 00:00:00 2001 From: Ben Adrian Sarmiento Date: Sun, 21 Jul 2024 03:35:09 +0200 Subject: [PATCH] Fix windows bug --- pkg/dav/response.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/dav/response.go b/pkg/dav/response.go index 69dd133..0f623ae 100644 --- a/pkg/dav/response.go +++ b/pkg/dav/response.go @@ -42,6 +42,10 @@ func VidHubDirectory(path, added string) string { if !strings.HasSuffix(path, "/") { path += "/" } + displayName := html.EscapeString(filepath.Base(path)) + if displayName == "\\" { + displayName = "/" + } return fmt.Sprintf(` %s @@ -54,7 +58,7 @@ func VidHubDirectory(path, added string) string { HTTP/1.1 200 OK -`, customPathEscape(path), html.EscapeString(filepath.Base(path)), added) +`, customPathEscape(path), displayName, added) } func VidHubFile(path string, fileSize int64, added string) string {