Skip to content

Commit

Permalink
gateway: add open flag when downloading an object (#4507)
Browse files Browse the repository at this point in the history
  • Loading branch information
SandyXSD committed Jun 20, 2024
1 parent ffa686e commit d7bc327
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/object.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func (f *jFile) Close() error {
}

func (j *juiceFS) Get(key string, off, limit int64) (io.ReadCloser, error) {
f, err := j.jfs.Open(ctx, j.path(key), 0)
f, err := j.jfs.Open(ctx, j.path(key), vfs.MODE_MASK_R)
if err != 0 {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/gateway/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ func (n *jfsObjects) GetObjectNInfo(ctx context.Context, bucket, object string,
if err != nil {
return
}
f, eno := n.fs.Open(mctx, n.path(bucket, object), 0)
f, eno := n.fs.Open(mctx, n.path(bucket, object), vfs.MODE_MASK_R)
if eno != 0 {
return nil, jfsToObjectErr(ctx, eno, bucket, object)
}
Expand Down

0 comments on commit d7bc327

Please sign in to comment.