[MM-45862] Set size and extension to fileinfo (#20681)

* Set size and extension to fileinfo

* Remove unnecessary check
Этот коммит содержится в:
Claudio Costa
2022-07-22 09:14:01 +02:00
коммит произвёл GitHub
родитель 3d7859396d
Коммит 9255671222
3 изменённых файлов: 16 добавлений и 4 удалений

Просмотреть файл

@@ -141,7 +141,7 @@ func GetInfoForBytes(name string, data io.ReadSeeker, size int) (*FileInfo, *App
extension := strings.ToLower(filepath.Ext(name))
info.MimeType = mime.TypeByExtension(extension)
if extension != "" && extension[0] == '.' {
if extension != "" {
// The client expects a file extension without the leading period
info.Extension = extension[1:]
} else {