Azure / Azure/Azurite

Azurite doesn't check if CORS rules is too many when set service properties

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

Description

**Error Description:**
In Azure, it will return an error when set service properties with too many CORS rules.
But in Azurite. it will set service properties successfully in this case.
Azure error is shown as following:
![Screenshot 2021-06-08 141740](https://user-images.githubusercontent.com/20970631/121133778-5350fa00-c865-11eb-9593-9486c39f646d.jpg)

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

async function main() {
const blobServiceClient = new BlobServiceClient("", new StorageSharedKeyCredential("", ""));
const cors = new Array();
const newCORS = {
allowedHeaders: "*",
allowedMethods: "GET",
allowedOrigins: "example.com",
exposedHeaders: "*",
maxAgeInSeconds: 8888
};
for (let i = 0; i < 6; i++) {
cors.push(newCORS);
}

await blobServiceClient.setProperties({cors:cors});
}

main().catch((err) => {
assert.ok(err);
});
```

**Expected Behavior:**
When set service properties with too many CORS rules, Azurite will return an error.

@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.