forked from TrueCloudLab/frostfs-rest-gw
[#40] Add FilePath field to ObjectBaseInfo
Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
parent
8917100857
commit
4fbd5a0c58
5 changed files with 29 additions and 6 deletions
|
@ -24,6 +24,10 @@ import (
|
|||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
const (
|
||||
attributeFilePath = "FilePath"
|
||||
)
|
||||
|
||||
// PutObjects handler that uploads object to NeoFS.
|
||||
func (a *API) PutObjects(params operations.PutObjectParams, principal *models.Principal) middleware.Responder {
|
||||
errorResponse := operations.NewPutObjectBadRequest()
|
||||
|
@ -307,9 +311,11 @@ func headObjectBaseInfo(ctx context.Context, p *pool.Pool, cnrID cid.ID, objID o
|
|||
}
|
||||
|
||||
for _, attr := range objInfo.Attributes() {
|
||||
if attr.Key() == object.AttributeFileName {
|
||||
switch attr.Key() {
|
||||
case object.AttributeFileName:
|
||||
resp.Name = attr.Value()
|
||||
break
|
||||
case attributeFilePath:
|
||||
resp.FilePath = attr.Value()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue