Fix windows bug
This commit is contained in:
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user