Skip to content

Commit

Permalink
Merge pull request #8583 from tangledbytes/utkarsh/backport/5.17/8576
Browse files Browse the repository at this point in the history
[Backport 5.17] send x-amz-restore header as one single header instead of 2 headers with same name
  • Loading branch information
nimrod-becker authored Dec 5, 2024
2 parents ee50557 + 3d376ed commit 289a81b
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 @@ -312,12 +312,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 289a81b

Please sign in to comment.