Fixes after review

- Maybe it could be rephrased to "attribute name prefixed with X-Attribute-"
- Maybe it worth renaming to userAttributeHeaderPrefix
- Requirement for having only one file uploaded at a time has to be reflected in documentation.
- Maybe this should be reflected in doc
- I'm not sure if missing timestamp attribute should be forced on gateway level. Normally it should be set by app and there should be a way not to set it.

Signed-off-by: Evgeniy Kulikov <kim@nspcc.ru>
This commit is contained in:
Evgeniy Kulikov 2021-01-26 12:40:01 +03:00
parent ace31ceefd
commit 3cbd4dbd09
No known key found for this signature in database
GPG key ID: BF6AEE0A2A699BF2
5 changed files with 30 additions and 9 deletions

View file

@ -124,8 +124,8 @@ func (a *app) upload(c *fasthttp.RequestCtx) {
attributes = append(attributes, filename)
}
// Attribute Timestamp wasn't set from header
if _, ok := filtered[object.AttributeTimestamp]; ok {
// Attribute Timestamp wasn't set from header and enabled by settings
if _, ok := filtered[object.AttributeTimestamp]; ok && a.enableDefaultTimestamp {
timestamp := object.NewAttribute()
timestamp.SetKey(object.AttributeTimestamp)
timestamp.SetValue(strconv.FormatInt(time.Now().Unix(), 10))