Skip to content

Commit

Permalink
cmd/gateway: always set content type (#5275)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhijian-pro authored and jiefenghuang committed Nov 26, 2024
1 parent 16d32f2 commit 0b74d2b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pkg/gateway/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -689,10 +689,8 @@ func (n *jfsObjects) GetObjectInfo(ctx context.Context, bucket, object string, o
etag, _ = n.fs.GetXattr(mctx, n.path(bucket, object), s3Etag)
}
size := fi.Size()
var contentType string
if fi.IsDir() {
size = 0
contentType = "application/octet-stream"
}
// key1=value1&key2=value2
var tagStr []byte
Expand All @@ -710,7 +708,7 @@ func (n *jfsObjects) GetObjectInfo(ctx context.Context, bucket, object string, o
IsDir: fi.IsDir(),
AccTime: fi.ModTime(),
ETag: string(etag),
ContentType: contentType,
ContentType: utils.GuessMimeType(object),
UserTags: string(tagStr),
UserDefined: minio.CleanMetadata(opts.UserDefined),
}, nil
Expand Down

0 comments on commit 0b74d2b

Please sign in to comment.