Skip to content

Commit

Permalink
send x-amz-restore header as one single header instead of 2 headers w…
Browse files Browse the repository at this point in the history
…ith same name

Signed-off-by: Utkarsh Srivastava <[email protected]>
  • Loading branch information
tangledbytes committed Dec 4, 2024
1 parent b53e772 commit fed95e1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/endpoint/s3/s3_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,12 +315,12 @@ function set_response_object_md(res, object_md) {
res.setHeader('x-amz-storage-class', storage_class);
}
if (object_md.restore_status?.ongoing || object_md.restore_status?.expiry_time) {
const restore = [`ongoing-request="${object_md.restore_status.ongoing}"`];
let restore = `ongoing-request="${object_md.restore_status.ongoing}"`;
if (!object_md.restore_status.ongoing && object_md.restore_status.expiry_time) {
// Expiry time is in UTC format
const expiry_date = new Date(object_md.restore_status.expiry_time).toUTCString();

restore.push(`expiry-date="${expiry_date}"`);
restore += `, expiry-date="${expiry_date}"`;
}

res.setHeader('x-amz-restore', restore);
Expand Down

0 comments on commit fed95e1

Please sign in to comment.