forked from TrueCloudLab/frostfs-http-gw
[#117] Fix FrostFS interface usage
HTTP Gateway expects io.Reader to work with payload, however `WithPayload` flag reads whole payload into header object. Signed-off-by: Alex Vanin <a.vanin@yadro.com>
This commit is contained in:
parent
27478995b5
commit
0f22ca43c1
5 changed files with 13 additions and 51 deletions
|
@ -157,9 +157,7 @@ func (h *Handler) zipObject(ctx context.Context, zipWriter *zip.Writer, addr oid
|
|||
PrmAuth: PrmAuth{
|
||||
BearerToken: btoken,
|
||||
},
|
||||
Address: addr,
|
||||
WithHeader: true,
|
||||
WithPayload: true,
|
||||
Address: addr,
|
||||
}
|
||||
|
||||
resGet, err := h.frostfs.ReadObject(ctx, prm)
|
||||
|
|
|
@ -54,12 +54,6 @@ type PrmObjectRead struct {
|
|||
// Address to read the object header from.
|
||||
Address oid.Address
|
||||
|
||||
// Flag to read object header.
|
||||
WithHeader bool
|
||||
|
||||
// Flag to read object payload. False overlaps payload range.
|
||||
WithPayload bool
|
||||
|
||||
// Offset-length range of the object payload to be read.
|
||||
PayloadRange [2]uint64
|
||||
}
|
||||
|
|
|
@ -33,8 +33,7 @@ func (h *Handler) headObject(ctx context.Context, req request, objectAddress oid
|
|||
PrmAuth: PrmAuth{
|
||||
BearerToken: btoken,
|
||||
},
|
||||
Address: objectAddress,
|
||||
WithHeader: true,
|
||||
Address: objectAddress,
|
||||
}
|
||||
|
||||
obj, err := h.frostfs.ReadObject(ctx, prm)
|
||||
|
@ -80,7 +79,6 @@ func (h *Handler) headObject(ctx context.Context, req request, objectAddress oid
|
|||
BearerToken: btoken,
|
||||
},
|
||||
Address: objectAddress,
|
||||
WithPayload: true,
|
||||
PayloadRange: [2]uint64{0, sz},
|
||||
}
|
||||
|
||||
|
|
|
@ -59,9 +59,7 @@ func (h *Handler) receiveFile(ctx context.Context, req request, objectAddress oi
|
|||
PrmAuth: PrmAuth{
|
||||
BearerToken: bearerToken(ctx),
|
||||
},
|
||||
Address: objectAddress,
|
||||
WithHeader: true,
|
||||
WithPayload: true,
|
||||
Address: objectAddress,
|
||||
}
|
||||
|
||||
rObj, err := h.frostfs.ReadObject(ctx, prm)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue