[#52] object/range: Attach received object header to result

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-09-26 10:50:50 +03:00 committed by Alex Vanin
parent 0490107165
commit abf9ad3573
3 changed files with 30 additions and 9 deletions

View file

@ -35,12 +35,12 @@ func NewService(opts ...Option) *Service {
// GetRange calls internal service and returns v2 object payload range stream.
func (s *Service) GetRange(ctx context.Context, req *objectV2.GetRangeRequest) (objectV2.GetRangeObjectStreamer, error) {
stream, err := s.svc.GetRange(ctx, toPrm(req))
r, err := s.svc.GetRange(ctx, toPrm(req))
if err != nil {
return nil, errors.Wrapf(err, "(%T) could not get object payload range data", s)
}
return fromResponse(stream), nil
return fromResponse(r.Stream()), nil
}
func WithInternalService(v *rangesvc.Service) Option {