Skip to content

Commit

Permalink
always set content type
Browse files Browse the repository at this point in the history
  • Loading branch information
zhijian-pro committed Nov 4, 2024
1 parent 902899e commit 3a95b0a
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions pkg/gateway/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -676,12 +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"
} else {
contentType = utils.GuessMimeType(object)
}
// key1=value1&key2=value2
var tagStr []byte
Expand All @@ -699,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 3a95b0a

Please sign in to comment.