forked from TrueCloudLab/frostfs-http-gw
[#111] Move attributes to a separate file
Signed-off-by: Angira Kekteeva <kira@nspcc.ru>
This commit is contained in:
parent
79501077ff
commit
dbbc9e05cf
6 changed files with 52 additions and 47 deletions
|
@ -14,6 +14,7 @@ import (
|
|||
|
||||
"github.com/nspcc-dev/neofs-http-gw/response"
|
||||
"github.com/nspcc-dev/neofs-http-gw/tokens"
|
||||
"github.com/nspcc-dev/neofs-http-gw/utils"
|
||||
"github.com/nspcc-dev/neofs-sdk-go/client"
|
||||
cid "github.com/nspcc-dev/neofs-sdk-go/container/id"
|
||||
"github.com/nspcc-dev/neofs-sdk-go/object"
|
||||
|
@ -152,7 +153,7 @@ func (r request) receiveFile(clnt pool.Object, objectAddress *object.Address) {
|
|||
if !isValidToken(key) || !isValidValue(val) {
|
||||
continue
|
||||
}
|
||||
r.Response.Header.Set("X-Attribute-"+key, val)
|
||||
r.Response.Header.Set(utils.UserAttributeHeaderPrefix+key, val)
|
||||
switch key {
|
||||
case object.AttributeFileName:
|
||||
filename = val
|
||||
|
|
|
@ -7,6 +7,7 @@ import (
|
|||
|
||||
"github.com/nspcc-dev/neofs-http-gw/response"
|
||||
"github.com/nspcc-dev/neofs-http-gw/tokens"
|
||||
"github.com/nspcc-dev/neofs-http-gw/utils"
|
||||
"github.com/nspcc-dev/neofs-sdk-go/client"
|
||||
"github.com/nspcc-dev/neofs-sdk-go/object"
|
||||
"github.com/nspcc-dev/neofs-sdk-go/pool"
|
||||
|
@ -40,7 +41,7 @@ func (r request) headObject(clnt pool.Object, objectAddress *object.Address) {
|
|||
if !isValidToken(key) || !isValidValue(val) {
|
||||
continue
|
||||
}
|
||||
r.Response.Header.Set("X-Attribute-"+key, val)
|
||||
r.Response.Header.Set(utils.UserAttributeHeaderPrefix+key, val)
|
||||
switch key {
|
||||
case object.AttributeTimestamp:
|
||||
value, err := strconv.ParseInt(val, 10, 64)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue