Skip to content

Commit a1dca53

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

File tree

6 files changed

+116
-217
lines changed

6 files changed

+116
-217
lines changed

src/endpoint/s3/s3_utils.js

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -667,15 +667,9 @@ function parse_body_logging_xml(req) {
667667
}
668668

669669
function get_http_response_date(res) {
670-
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;
673-
}
674-
675-
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;
670+
if (res.$metadata.httpStatusCode !== 200) throw new Error("Response return with error");
671+
if (!res.LastModified) throw new Error("Date not found in response header");
672+
return res.LastModified;
679673
}
680674

681675
function get_response_field_encoder(req) {
@@ -861,7 +855,6 @@ exports.parse_lock_header = parse_lock_header;
861855
exports.parse_body_object_lock_conf_xml = parse_body_object_lock_conf_xml;
862856
exports.parse_to_camel_case = parse_to_camel_case;
863857
exports._is_valid_retention = _is_valid_retention;
864-
exports.get_http_response_from_resp = get_http_response_from_resp;
865858
exports.get_http_response_date = get_http_response_date;
866859
exports.XATTR_SORT_SYMBOL = XATTR_SORT_SYMBOL;
867860
exports.get_response_field_encoder = get_response_field_encoder;

0 commit comments

Comments
 (0)