scality / cloudserver

Zenko CloudServer, an open-source Node.js implementation of the Amazon S3 protocol on the front-end and backend storage capabilities to multiple clouds, including Azure and Google.
https://www.zenko.io/cloudserver
Apache License 2.0
1.71k stars 241 forks source link

KeyCount missing #1737

Open mayo opened 5 years ago

mayo commented 5 years ago

Bug report information

The XML responses seem to be missing KeyCount element (https://docs.aws.amazon.com/AmazonS3/latest/API/v2-RESTBucketGET.html)

Description

When requesting bucket contents, the KeyCount element, which normally states number of items in the prefix (or response, if hitting MaxKeys) is missing.

Steps to reproduce the issue

Request bucket listing, observe the response.

Actual result

The response comes back without KeyCount element.

Expected result

KeyCount element should be present, as per https://docs.aws.amazon.com/AmazonS3/latest/API/v2-RESTBucketGET.html

Additional information

Running zenko/cloudserver:latest docker image with CloudServer 8.1.0-beta.

mayo commented 5 years ago

A quick fix for this is here, if anyone wants to review. Tests will come later where I have more time.

https://github.com/scality/cloudserver/compare/development/8.1...mayo:development/8.1

dora-korpar commented 5 years ago

Hey @mayo, thanks for implementing a fix! It looks good to me, just adding some tests would be awesome 👍