From edd44ea981de92af74fd7a86672cdd82750cef69 Mon Sep 17 00:00:00 2001 From: Evgeniy Kulikov Date: Thu, 20 Aug 2020 02:32:42 +0300 Subject: [PATCH] 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 --- api/layer/object.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/layer/object.go b/api/layer/object.go index c7d160dbe..711a815d0 100644 --- a/api/layer/object.go +++ b/api/layer/object.go @@ -390,7 +390,10 @@ func (n *layer) objectPut(ctx context.Context, p putParams) (*object.Object, err 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) obj := &object.Object{