Comparing version 1.8.2 to 1.8.3
@@ -18,4 +18,4 @@ 'use strict'; | ||
delimiter: request.query.delimiter, | ||
marker: request.query.marker || 0, | ||
maxresults: request.query.maxresults || 5000, | ||
marker: parseInt(request.query.marker) || 0, | ||
maxresults: parseInt(request.query.maxresults) || 5000, | ||
include: request.query.include | ||
@@ -27,3 +27,3 @@ } | ||
const blobPrefixes = []; | ||
const transformedModel = this._transformBlobList(response.payload, query, blobPrefixes, response.displayNextMarker); | ||
const transformedModel = this._transformBlobList(response.payload, query, blobPrefixes, response.nextMarker); | ||
let xmlDoc = js2xmlparser.parse('EnumerationResults', transformedModel); | ||
@@ -42,10 +42,9 @@ xmlDoc = xmlDoc.replace(`<EnumerationResults>`, `<EnumerationResults ServiceEndpoint="http://localhost:10000/devstoreaccount1" ContainerName="${request.containerName}">`); | ||
_transformBlobList(blobList, query, blobPrefixes, displayNextMarker) { | ||
_transformBlobList(blobList, query, blobPrefixes, nextMarker) { | ||
let xmlBlobListModel = new model.BlobList(); | ||
(query.prefix === undefined) ? delete xmlBlobListModel.Prefix : xmlBlobListModel.Prefix = query.prefix; | ||
(query.maxresults === undefined) ? delete xmlBlobListModel.MaxResults : xmlBlobListModel.MaxResults = query.maxresults; | ||
(query.marker === undefined) ? delete xmlBlobListModel.Marker : xmlBlobListModel.Marker = query.marker; | ||
(query.delimiter === undefined) ? delete xmlBlobListModel.Delimiter : xmlBlobListModel.Delimiter = query.delimiter; | ||
if (displayNextMarker) { | ||
xmlBlobListModel.NextMarker = (query.marker !== undefined) ? parseInt(query.marker) + 1 : 1; | ||
if (nextMarker > 0) { | ||
xmlBlobListModel.NextMarker = nextMarker; | ||
} | ||
@@ -71,2 +70,7 @@ if (query.delimiter !== undefined) { | ||
} | ||
if (query.marker) { | ||
(blobList.length === 0) ? delete xmlBlobListModel.Marker : xmlBlobListModel.Marker = blobList[0].original.name; | ||
} | ||
for (const blob of blobList) { | ||
@@ -73,0 +77,0 @@ let modelBlob = new model.Blob(blob.original.name, blob.original.blobType); |
@@ -186,10 +186,6 @@ 'use strict'; | ||
const totalHits = blobs.count(); | ||
let offset = parseInt(query.marker); | ||
if (query.marker) { | ||
offset *= query.maxresults; | ||
blobs = blobs.offset(offset); | ||
} | ||
const offset = query.marker !== undefined ? query.marker : 0; | ||
blobs = blobs.offset(offset); | ||
const response = new AzuriteResponse({ payload: BlobProxy.createFromArray(blobs.limit(query.maxresults).data(), request.containerName) }); | ||
// Fixme: This is ugly, find better way to pass these params to action | ||
response.displayNextMarker = offset + parseInt(query.maxresults) < totalHits; | ||
response.nextMarker = (totalHits > query.maxresults + offset) ? (query.maxresults + offset) : 0; | ||
return BbPromise.resolve(response); | ||
@@ -196,0 +192,0 @@ } |
{ | ||
"name": "azurite", | ||
"version": "1.8.2", | ||
"version": "1.8.3", | ||
"description": "A lightweight server clone of Azure Blob Storage that simulates most of the commands supported by it with minimal dependencies.", | ||
@@ -5,0 +5,0 @@ "scripts": { |
# 1.0 | ||
## 1.8.3 | ||
- fixes [#144](https://github.com/arafato/azurite/issues/144): Blob Storage Bugfix: Wrong offset calculation for continuation token | ||
## 1.8.2 | ||
- fixes [#142](https://github.com/arafato/azurite/issues/142): Blob Storage Bugfix | ||
## 1.8.1 | ||
@@ -3,0 +7,0 @@ - fixes [#128](https://github.com/arafato/azurite/pull/128): Queue: Adds support for Queue Length in metadata -> thanks to @leafnode for PR! |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
313811
6025