Azure / Azure/Azurite

The error returned in azurite is inconsistent with the one in azure cloud when create and resize page blob with invalid page size.

Open
#641 3 comments 0 reactions 1 assignee Claimed by @blueww View on GitHub
alignment blob-storage NewArch stale
Dominant language
TypeScript
Stars
2.3k
Forks
393
Avg merge
1d 20h
Merged PRs (30d)
36

Description

**Error Description:**
The error returned in azurite is inconsistent with the one in azure cloud when create and resize page blob with invalid page size.
In azure, the error is shown as following:
![Screenshot 2020-11-19 094736](https://user-images.githubusercontent.com/20970631/99610203-51038b80-2a4c-11eb-9742-91a1d2be868e.png)
In azurite, the error is shown as following:
![Screenshot 2020-11-19 094913](https://user-images.githubusercontent.com/20970631/99610300-827c5700-2a4c-11eb-9b2e-0e2b76435a8a.png)

**To Reproduce**
Please run the demo code as following:
```
import {
BlobServiceClient, BlockBlobClient, PageBlobClient
} from "@azure/storage-blob";
import * as assert from "assert"

async function main(){
const blobServiceClient = await BlobServiceClient.fromConnectionString("");
const containerClient = await blobServiceClient.getContainerClient("");
const pageBlobClient = await containerClient.getPageBlobClient("");
try{
await pageBlobClient.create(511);
}catch(err){
console.log(err);
assert.ok((err as any).response.parsedBody.Code === "InvalidHeaderValue");
}
}

main();
```

**Error Track:**
The reason maybe is that the check for create and resize page blob with invalid page size in Azurite is different from the one in Azure. The check code is shown as following:
[https://github.com/Azure/Azurite/blob/master/src/blob/handlers/PageBlobHandler.ts#L75](https://github.com/Azure/Azurite/blob/master/src/blob/handlers/PageBlobHandler.ts#L75)
![Screenshot 2020-11-19 095458](https://user-images.githubusercontent.com/20970631/99610730-531a1a00-2a4d-11eb-95c3-a25b40a09bc3.png)

**Expected Behavior**
The error returned in azurite is consistent with the one in azure cloud when create and resize page blob with invalid page size.

@jongio for notification.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.