fix: use file extension to search for content-type (#1313)

pull/1324/head
WeidiDeng 2 years ago committed by GitHub
parent fb56b27062
commit 3fa1249678
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -10,7 +10,9 @@ import (
"encoding/xml"
"errors"
"fmt"
"mime"
"net/http"
"path/filepath"
"strconv"
"time"
@ -381,7 +383,7 @@ func findContentType(ctx context.Context, fs *filesystem.FileSystem, ls LockSyst
//// Rewind file.
//_, err = f.Seek(0, os.SEEK_SET)
//return ctype, err
return "", nil
return mime.TypeByExtension(filepath.Ext(name)), nil
}
// ETager is an optional interface for the os.FileInfo objects

Loading…
Cancel
Save