fix: use file extension to search for content-type (#1313)
This commit is contained in:
parent
fb56b27062
commit
3fa1249678
1 changed files with 3 additions and 1 deletions
|
@ -10,7 +10,9 @@ import (
|
||||||
"encoding/xml"
|
"encoding/xml"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"mime"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"path/filepath"
|
||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
@ -381,7 +383,7 @@ func findContentType(ctx context.Context, fs *filesystem.FileSystem, ls LockSyst
|
||||||
//// Rewind file.
|
//// Rewind file.
|
||||||
//_, err = f.Seek(0, os.SEEK_SET)
|
//_, err = f.Seek(0, os.SEEK_SET)
|
||||||
//return ctype, err
|
//return ctype, err
|
||||||
return "", nil
|
return mime.TypeByExtension(filepath.Ext(name)), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ETager is an optional interface for the os.FileInfo objects
|
// ETager is an optional interface for the os.FileInfo objects
|
||||||
|
|
Loading…
Add table
Reference in a new issue