Open zzhxiaofeng opened 3 years ago
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:
To Reproduce Please run the demo code as following:
import { BlobServiceClient } from "@azure/storage-blob"; async function main(){ const blobServiceClient = await BlobServiceClient.fromConnectionString("<Azurite-https-connectionString>"); const containerClient=await blobServiceClient.getContainerClient("<container-name>"); const appendBlobClient = await containerClient.getAppendBlobClient("<blob-name>"); } main();
Error Track:
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
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/artifacts/specifications.ts#L2027
Expected Behavior When create blob with blob name that is empty string in azurite, it can create blob successfully.
@jongio for notification.
@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.
azsdk-azurite
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:
To Reproduce Please run the demo code as following:
Error Track:
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
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/artifacts/specifications.ts#L2027
Expected Behavior When create blob with blob name that is empty string in azurite, it can create blob successfully.
@jongio for notification.