Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 23 additions & 11 deletions lib/pkgcloud/azure/storage/client/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -329,25 +329,37 @@ exports.getFiles = function (container, options, callback) {
options = {};
}

const qs = {
restype: 'container',
comp: 'list'
};

if (options.limit) {
qs.maxresults = options.limit;
}
if (options.marker) {
qs.marker = options.marker;
}
if (options.prefix) {
qs.prefix = options.prefix;
}

this._xmlRequest({
method: 'GET',
path: containerName,
qs: {
restype: 'container',
comp: 'list'
}
qs: qs
}, function (err, body) {
if (err) {
return callback(err);
}
if (body.Blobs && body.Blobs.Blob) {
return callback(null, self._toArray(body.Blobs.Blob).map(function (file) {

callback(null,
body.Blobs && body.Blobs.Blob && self._toArray(body.Blobs.Blob)
.map(function (file) {
file.container = container;
return new storage.File(self, file);
}));
}

callback(null, []);
}) || [],
'string' == typeof body.NextMarker && body.NextMarker
);
});
};

4 changes: 2 additions & 2 deletions lib/pkgcloud/azure/utils/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -2045,7 +2045,7 @@ var Constants = {
* @const
* @type {string}
*/
TARGET_STORAGE_VERSION: '2011-08-18',
TARGET_STORAGE_VERSION: '2014-02-14',

/**
* The UserAgent header.
Expand Down Expand Up @@ -2559,4 +2559,4 @@ var Constants = {
}
};

module.exports = Constants;
module.exports = Constants;