From a5c89b78bcd8986a69a322fc212312f870782aa5 Mon Sep 17 00:00:00 2001 From: Artem Tataurov Date: Fri, 14 Apr 2023 16:46:51 +0300 Subject: [PATCH] [#79] Return X-Owner-Id in head-bucket response Signed-off-by: Artem Tataurov --- CHANGELOG.md | 1 + api/handler/head.go | 1 + api/headers.go | 1 + 3 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index af1d92b..422c17e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ This document outlines major changes between releases. - Don't count pool error on client abort (#35) ### Added +- Return `X-Owner-Id` in `head-bucket` response (#79) - Return container name in `head-bucket` response (TrueCloudLab#18) - Billing metrics (TrueCloudLab#5) - Multiple configs support (TrueCloudLab#21) diff --git a/api/handler/head.go b/api/handler/head.go index 8c7ef69..0ac519e 100644 --- a/api/handler/head.go +++ b/api/handler/head.go @@ -122,6 +122,7 @@ func (h *handler) HeadBucketHandler(w http.ResponseWriter, r *http.Request) { return } + w.Header().Set(api.OwnerID, bktInfo.Owner.EncodeToString()) w.Header().Set(api.ContainerID, bktInfo.CID.EncodeToString()) w.Header().Set(api.AmzBucketRegion, bktInfo.LocationConstraint) diff --git a/api/headers.go b/api/headers.go index db9fc2a..42280ad 100644 --- a/api/headers.go +++ b/api/headers.go @@ -62,6 +62,7 @@ const ( AmzServerSideEncryptionCustomerKey = "x-amz-server-side-encryption-customer-key" AmzServerSideEncryptionCustomerKeyMD5 = "x-amz-server-side-encryption-customer-key-MD5" + OwnerID = "X-Owner-Id" ContainerID = "X-Container-Id" ContainerName = "X-Container-Name" ContainerZone = "X-Container-Zone"