Azure / Azure/Azurite

Azurite doesn't support Create Blob with blob name that is empty string

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

Description

**Error Description:**
In Azure, it will create blob successfully when create blob with blob name that is empty string.
But in Azurite, it will return an error as following in this case:
![Screenshot 2020-11-18 142706](https://user-images.githubusercontent.com/20970631/99493425-27922380-29aa-11eb-9a2c-5c13b3a6367b.png)

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

async function main(){
const blobServiceClient = await BlobServiceClient.fromConnectionString("");
const containerClient=await blobServiceClient.getContainerClient("");
const appendBlobClient = await containerClient.getAppendBlobClient("");
}

main();
```

**Error Track:**
1. When send request, Azurite will construct a pattern by request to match the corresponding handler method. it will construct a pattern(/container) without blob when use a blob name of empty string to create blob
[https://github.com/Azure/Azurite/blob/master/src/blob/middlewares/blobStorageContext.middleware.ts#L80](https://github.com/Azure/Azurite/blob/master/src/blob/middlewares/blobStorageContext.middleware.ts#L80)
![Screenshot 2020-11-18 110406](https://user-images.githubusercontent.com/20970631/99493648-91aac880-29aa-11eb-9f5c-13f20a9110f5.png)

2. When use the pattern to match handler method, it doesn't match the blob create handler method because the blob create handler method need a pattern like "container/blob".
[https://github.com/Azure/Azurite/blob/master/src/blob/generated/middleware/dispatch.middleware.ts#L105](https://github.com/Azure/Azurite/blob/master/src/blob/generated/middleware/dispatch.middleware.ts#L105)
![Screenshot 2020-11-18 111154](https://user-images.githubusercontent.com/20970631/99495172-33331980-29ad-11eb-918c-e5234486555e.png)
[https://github.com/Azure/Azurite/blob/master/src/blob/generated/artifacts/specifications.ts#L2027](https://github.com/Azure/Azurite/blob/master/src/blob/generated/artifacts/specifications.ts#L2027)
![Screenshot 2020-11-18 145639](https://user-images.githubusercontent.com/20970631/99495927-61fdbf80-29ae-11eb-8e15-ba1af16c3e03.png)

**Expected Behavior**
When create blob with blob name that is empty string in azurite, it can create blob successfully.

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