hawkbit-extensions icon indicating copy to clipboard operation
hawkbit-extensions copied to clipboard

S3 extension misuses AWS SDK to get content size

Open zyga opened this issue 9 months ago • 0 comments

Getting the content size should not happen with s3Object.getObjectMetadata as that is too late, and we're already GETting the whole blob needlessly.

From my local patch:

+        var req = new GetObjectMetadataRequest(s3Properties.getBucketName(), key);
+        var objMeta = amazonS3.getObjectMetadata(req);

This way we can get the meta-data in a simple HEAD request, which is not wasting bandwidth.

zyga avatar Oct 02 '23 15:10 zyga