Files
floci/compatibility-tests/sdk-test-java/src
Priamo Germosen a88ef42b4b feat(s3): read one part of an object with GetObject and HeadObject partNumber (#5569)
GetObject and HeadObject ignored partNumber, so a client reading a
multipart object one part at a time downloaded the whole object for
every part, and never learned how many parts there were. The API
Reference describes partNumber as "effectively" a ranged GET or HEAD
for that part, with x-amz-mp-parts-count "only returned if you specify
partNumber in your request and the object was uploaded as a multipart
upload".

Both now answer partNumber as S3 does in LocalStack's AWS-validated
test_get_object_part, test_get_object_part_checksum and
test_complete_multipart_parts_checksum captures: 206 with the part's
Content-Range and Content-Length, the object's ETag, and
x-amz-mp-parts-count for an object completed from a multipart upload.
An object stored in one request is its own part 1. A part the object
does not have is 416 InvalidPartNumber, naming PartNumberRequested and
ActualPartCount, and partNumber with a Range header is 400
InvalidRequest. A part streams from storage like a range, so the parts
of a large object are read one at a time without holding it.

With checksum mode on, a part of an object with a COMPOSITE checksum
gets that part's own checksum, of type COMPOSITE, and a part that is all
of its object gets the object's checksum; any other part of a
FULL_OBJECT multipart object gets none, as the captures show.

A part number below 1 is 400 InvalidArgument, and one above the part
count, past 10,000 or not, is the 416, as the AWS SDK for Java documents
for partNumber; the 400 carries the wording and fields the captures
record for UploadPart. Part 1 of an empty object succeeds, as the AWS
SDKs' integration tests that download an empty object by part expect,
with no Content-Range, which the CRT client reads only from a part with
bytes, and so with 200, since a 206 must carry one (RFC 9110 15.3.7).

GetObject's ranged response and HeadObject now build their common
headers with GetObject's, given the length served.
2026-10-13 17:46:30 -05:00
..