Azure / Azurite

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

Azurite doesn't check if the parameter sequenceNumber is valid when use Update Sequence Number operation on page blob. #643

Open zzhxiaofeng opened 3 years ago

zzhxiaofeng commented 3 years ago

Error Description: In Azure, it will return error "InvalidHeaderValue" when use Update Sequence Number operation with invalid sequenceNumber. But in Azurite, it will update sequence number successfully in this case. Azure error is shown as following: Screenshot 2020-11-19 100728

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-connnectionString>");
  const containerClient=await blobServiceClient.getContainerClient("<container-name>");
  const pageBlobClient = containerClient.getPageBlobClient("<blob-name>");
  try{
    await pageBlobClient.updateSequenceNumber('update',1);
  }catch(err){
    console.log(err);
    assert.ok((err as any).response.parsedBody.Code === "InvalidHeaderValue");
  }
}

main();

Expected Behavior When use Update Sequence Number operation with invalid sequenceNumber, Azurite return error "InvalidHeaderValue".

@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