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()
|
//defer f.Close()
|
||||||
// This implementation is based on serveContent's code in the standard net/http package.
|
// This implementation is based on serveContent's code in the standard net/http package.
|
||||||
ctype := mime.TypeByExtension(path.Ext(name))
|
ctype := mime.TypeByExtension(path.Ext(name))
|
||||||
if ctype != "" {
|
|
||||||
return ctype, nil
|
return ctype, nil
|
||||||
}
|
//if ctype != "" {
|
||||||
return "application/octet-stream", nil
|
// return ctype, nil
|
||||||
|
//}
|
||||||
|
//return "application/octet-stream", nil
|
||||||
// Read a chunk to decide between utf-8 text and binary.
|
// Read a chunk to decide between utf-8 text and binary.
|
||||||
//var buf [512]byte
|
//var buf [512]byte
|
||||||
//n, err := io.ReadFull(f, buf[:])
|
//n, err := io.ReadFull(f, buf[:])
|
||||||
|
|
Loading…
Reference in New Issue