Refactors 2
This commit is contained in:
@@ -2,7 +2,6 @@ package dav
|
||||
|
||||
import (
|
||||
"net/url"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@@ -27,31 +26,3 @@ func escapeForXML(input string) string {
|
||||
input = strings.ReplaceAll(input, "@", "%40")
|
||||
return input
|
||||
}
|
||||
|
||||
func getContentType(filename string) string {
|
||||
filename = strings.ToLower(filename)
|
||||
switch filepath.Ext(filename) {
|
||||
case ".avi":
|
||||
return "video/x-msvideo"
|
||||
case ".m2ts":
|
||||
return "video/mp2t"
|
||||
case ".m4v":
|
||||
return "video/x-m4v"
|
||||
case ".mkv":
|
||||
return "video/x-matroska"
|
||||
case ".mov":
|
||||
return "video/quicktime"
|
||||
case ".mp4":
|
||||
return "video/mp4"
|
||||
case ".mpg":
|
||||
return "video/mpeg"
|
||||
case ".mpeg":
|
||||
return "video/mpeg"
|
||||
case ".ts":
|
||||
return "video/mp2t"
|
||||
case ".wmv":
|
||||
return "video/x-ms-wmv"
|
||||
default:
|
||||
return "application/octet-stream"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user