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 Nov 5, 2024
1 parent da1c8b6 commit 78f3dd9
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 @@ -676,10 +676,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 @@ -697,7 +695,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 78f3dd9

Please sign in to comment.