mirror of https://github.com/Xhofe/alist
fix: set default mimetype to empty string (close #1710)
parent
d8dc8d8623
commit
ca177cc3b9
|
@ -419,10 +419,11 @@ func findContentType(ctx context.Context, ls LockSystem, name string, fi model.O
|
|||
//defer f.Close()
|
||||
// This implementation is based on serveContent's code in the standard net/http package.
|
||||
ctype := mime.TypeByExtension(path.Ext(name))
|
||||
if ctype != "" {
|
||||
return ctype, nil
|
||||
}
|
||||
return "application/octet-stream", nil
|
||||
return ctype, nil
|
||||
//if ctype != "" {
|
||||
// return ctype, nil
|
||||
//}
|
||||
//return "application/octet-stream", nil
|
||||
// Read a chunk to decide between utf-8 text and binary.
|
||||
//var buf [512]byte
|
||||
//n, err := io.ReadFull(f, buf[:])
|
||||
|
|
Loading…
Reference in New Issue