Azure / azure-storage-php

Microsoft Azure Storage Library for PHP
MIT License
217 stars 198 forks source link

Access condition not taken into account on big blob #256

Closed psdesse closed 3 years ago

psdesse commented 3 years ago

Which service(blob, file, queue, table) does this issue concern?

blob

Which version of the SDK was used?

microsoft/azure-storage-blob 1.5.1 (and previous version)

What's the PHP/OS version?

Debian 10 PHP 7.3.19

What problem was encountered?

When adding access condition on a create blob request, if the file is big enough, the access condition is not put on the commit blob request.

Steps to reproduce the issue?

  1. Create a blob that is bigger than 100MB
  2. Call create again with createBlockBlob but this time add an access condition like $options->setAccessConditions(AccessCondition::ifNoneMatch('*'));

Have you found a mitigation/solution?

We have made a fork to fix the issue on the Azure library. It is a one line in azure-storage-blob/src/Blob/Models/CommitBlobBlocksOptions.php:220 where we added $result->setAccessConditions($options->getAccessConditions());.

Is there a failing request ID related to this problem returned by server? What is it?

N/A

What is the storage account name and time frame of your last reproduce? (UTC YYYY/MM/DD hh:mm:ss)

N/A

(If you think some of the information should not be shared publicly, you can e-mail the main Microsoft contributors of the repository instead.)

katmsft commented 3 years ago

This is added to our backlog, thanks for raising the issue.