Fix windows bug

This commit is contained in:
Ben Adrian Sarmiento
2024-07-21 03:35:09 +02:00
parent 66053ed621
commit 9053880623

View File

@@ -42,6 +42,10 @@ func VidHubDirectory(path, added string) string {
if !strings.HasSuffix(path, "/") { if !strings.HasSuffix(path, "/") {
path += "/" path += "/"
} }
displayName := html.EscapeString(filepath.Base(path))
if displayName == "\\" {
displayName = "/"
}
return fmt.Sprintf(`<d:response> return fmt.Sprintf(`<d:response>
<d:href>%s</d:href> <d:href>%s</d:href>
<d:propstat> <d:propstat>
@@ -54,7 +58,7 @@ func VidHubDirectory(path, added string) string {
</d:prop> </d:prop>
<d:status>HTTP/1.1 200 OK</d:status> <d:status>HTTP/1.1 200 OK</d:status>
</d:propstat> </d:propstat>
</d:response>`, customPathEscape(path), html.EscapeString(filepath.Base(path)), added) </d:response>`, customPathEscape(path), displayName, added)
} }
func VidHubFile(path string, fileSize int64, added string) string { func VidHubFile(path string, fileSize int64, added string) string {