fix: unknow contentType for ArchiveFileHandler (#19451)

This commit is contained in:
jiuker 2024-04-09 18:41:25 +08:00 committed by GitHub
parent 7bb0f32332
commit a481825ae1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 4 deletions

View File

@ -22,7 +22,9 @@ import (
"context"
"errors"
"io"
"mime"
"net/http"
"path/filepath"
"sort"
"strings"
@ -166,10 +168,11 @@ func (api objectAPIHandlers) getObjectInArchiveFileHandler(ctx context.Context,
// New object info
fileObjInfo := ObjectInfo{
Bucket: bucket,
Name: object,
Size: int64(file.UncompressedSize64),
ModTime: zipObjInfo.ModTime,
Bucket: bucket,
Name: object,
Size: int64(file.UncompressedSize64),
ModTime: zipObjInfo.ModTime,
ContentType: mime.TypeByExtension(filepath.Ext(object)),
}
var rc io.ReadCloser