From 91c894cb8ce306efa4e2d51a9d819aa35b2e36b0 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Thu, 29 Apr 2021 23:09:37 +0300 Subject: [PATCH] downloader: set object/container/owner x-attributes after other ones Avoid name clashes with regular attributes. --- downloader/download.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/downloader/download.go b/downloader/download.go index f52861b..60fca76 100644 --- a/downloader/download.go +++ b/downloader/download.go @@ -105,9 +105,6 @@ func (r *request) receiveFile(options *neofs.GetOptions) { dis = "attachment" } r.Response.Header.Set("Content-Length", strconv.FormatUint(obj.PayloadSize(), 10)) - r.Response.Header.Set("x-object-id", obj.ID().String()) - r.Response.Header.Set("x-owner-id", obj.OwnerID().String()) - r.Response.Header.Set("x-container-id", obj.ContainerID().String()) for _, attr := range obj.Attributes() { key := attr.Key() val := attr.Value() @@ -128,6 +125,9 @@ func (r *request) receiveFile(options *neofs.GetOptions) { time.Unix(value, 0).Format(time.RFC1123)) } } + r.Response.Header.Set("x-object-id", obj.ID().String()) + r.Response.Header.Set("x-owner-id", obj.OwnerID().String()) + r.Response.Header.Set("x-container-id", obj.ContainerID().String()) r.SetContentType(writer.contentType) r.Response.Header.Set("Content-Disposition", dis+"; filename="+path.Base(filename)) }