[#235] object/head: Support raw flag in service

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-12-08 15:59:01 +03:00 committed by Alex Vanin
parent 1d23483828
commit 397d912e19
5 changed files with 33 additions and 3 deletions

View file

@ -15,7 +15,8 @@ func toPrm(req *objectV2.HeadRequest) *headsvc.Prm {
object.NewAddressFromV2(body.GetAddress()),
).
Short(body.GetMainOnly()).
WithCommonPrm(util.CommonPrmFromV2(req))
WithCommonPrm(util.CommonPrmFromV2(req)).
WithRaw(body.GetRaw())
}
func fromResponse(r *headsvc.Response, short bool) *objectV2.HeadResponse {
@ -55,3 +56,14 @@ func shortPartFromResponse(r *headsvc.Response) objectV2.GetHeaderPart {
return sh
}
func splitInfoResponse(info *object.SplitInfo) *objectV2.HeadResponse {
resp := new(objectV2.HeadResponse)
body := new(objectV2.HeadResponseBody)
resp.SetBody(body)
body.SetHeaderPart(info.ToV2())
return resp
}