Check that aws filename wasn't set

we should check that filename header wasn't set, otherwise we should not change custom filename

Signed-off-by: Evgeniy Kulikov <kim@nspcc.ru>
This commit is contained in:
Evgeniy Kulikov 2020-08-20 02:32:42 +03:00
parent 00a17d8316
commit edd44ea981

View file

@ -390,7 +390,10 @@ func (n *layer) objectPut(ctx context.Context, p putParams) (*object.Object, err
p.userHeaders = make(map[string]string) p.userHeaders = make(map[string]string)
} }
p.userHeaders[AWS3NameHeader] = p.name // Set object name if not set before
if _, ok := p.userHeaders[AWS3NameHeader]; !ok {
p.userHeaders[AWS3NameHeader] = p.name
}
readBuffer := make([]byte, dataChunkSize) readBuffer := make([]byte, dataChunkSize)
obj := &object.Object{ obj := &object.Object{