Skip to content

Commit 4b2e592

Browse files
committed
SDK | Upgrade AWS SDK to v3 - Namespace_S3
Signed-off-by: Naveen Paul <[email protected]>
1 parent b7918b3 commit 4b2e592

File tree

6 files changed

+116
-211
lines changed

6 files changed

+116
-211
lines changed

src/endpoint/s3/s3_utils.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -668,14 +668,13 @@ function parse_body_logging_xml(req) {
668668

669669
function get_http_response_date(res) {
670670
const r = get_http_response_from_resp(res);
671-
if (!r.httpResponse.headers.date) throw new Error("date not found in response header");
672-
return r.httpResponse.headers.date;
671+
if (!r.LastModified) throw new Error("date not found in response header");
672+
return r.LastModified;
673673
}
674674

675675
function get_http_response_from_resp(res) {
676-
const r = res.$response;
677-
if (!r) throw new Error("no $response in s3 returned object");
678-
return r;
676+
if (res.$metadata.httpStatusCode !== 200) throw new Error("Response return with error");
677+
return res;
679678
}
680679

681680
function get_response_field_encoder(req) {

0 commit comments

Comments
 (0)