Skip to content

Commit

Permalink
Merge pull request #8576 from tangledbytes/utkarsh/fix/amz-restore-he…
Browse files Browse the repository at this point in the history
…ader-2

[GLACIER] Send x-amz-restore header as one single header instead of 2 headers with same name
  • Loading branch information
tangledbytes authored Dec 5, 2024
2 parents b53e772 + fed95e1 commit 8207cad
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 8207cad

Please sign in to comment.