KeyCount should return object count + common prefix count.
see S3 example: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html#API_ListObjectsV2_Example_5
Related: https://github.com/docker/distribution/issues/3200
Signed-off-by: 胡玮文 <huww98@outlook.com>
(cherry picked from commit
f96a6fdad16da2a7093f538ee577248dfbc65ca1)
if (is_truncated && !next_marker.empty()) {
s->formatter->dump_string("NextContinuationToken", next_marker.name);
}
- s->formatter->dump_int("KeyCount",objs.size());
+ s->formatter->dump_int("KeyCount", objs.size() + common_prefixes.size());
if (start_after_exist) {
s->formatter->dump_string("StartAfter", startAfter);
}