fix(webdav): set mime by ext if it's empty

This commit is contained in:
Noah Hsu
2022-10-09 19:29:55 +08:00
parent 30f992c6a8
commit 8c69260972
4 changed files with 16 additions and 7 deletions

View File

@ -3,7 +3,6 @@ package fs
import (
"fmt"
"io"
"mime"
"net/http"
"os"
stdpath "path"
@ -38,7 +37,7 @@ var httpClient = &http.Client{}
func getFileStreamFromLink(file model.Obj, link *model.Link) (model.FileStreamer, error) {
var rc io.ReadCloser
mimetype := mime.TypeByExtension(stdpath.Ext(file.GetName()))
mimetype := utils.GetMimeType(file.GetName())
if link.Data != nil {
rc = link.Data
} else if link.FilePath != nil {