Azure / Azurite

A lightweight server clone of Azure Storage that simulates most of the commands supported by it with minimal dependencies
MIT License
1.8k stars 320 forks source link

Azurite doesn't check if continuationToken is valid when use List Containers operation on blob service #644

Open zzhxiaofeng opened 3 years ago

zzhxiaofeng commented 3 years ago

Error Description: In Azure, it will return error "OutOfRangeInput" when use List Containers operation with invalid continuationToken on blob service. But in Azurite, it will list containers successfully in this case. Azure error is shown as following: Screenshot 2020-11-19 102408

To Reproduce The demo code is shown as following:

import {
  BlobServiceClient
} from "@azure/storage-blob";
import * as assert from "assert"

async function main() {
  const blobServiceClient = await BlobServiceClient.fromConnectionString("<Azurite-https-connectionString>");
  try{
    const result = (await blobServiceClient.listContainers().byPage({ continuationToken: "garbage" }).next()).value;
  }catch(err){
    console.log(err);
    assert.ok((err as any).response.parsedBody.Code === "OutOfRangeInput");
  }
}

main();

Expected Behavior When use List Containers operation with invalid continuationToken on blob service, Azurite return error "OutOfRangeInput".

@jongio for notification.

blueww commented 3 years ago

@zzhxiaofeng Thanks for raising the issue! We will evaluate it.

We welcome contribution to Azurite. It would be great if you could contribute the the fix of this issue.

v-xuto commented 3 years ago

azsdk-azurite