From 2e9b4b7492d4c4b76b1c30facdd223321573dc30 Mon Sep 17 00:00:00 2001 From: Zach Bimson Date: Fri, 18 Jun 2021 16:23:58 +0100 Subject: [PATCH 1/4] Add additional header constant for ms-blob-type --- azure-storage-common/src/Common/Internal/Resources.php | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-storage-common/src/Common/Internal/Resources.php b/azure-storage-common/src/Common/Internal/Resources.php index 48128d4f..333d9a5c 100644 --- a/azure-storage-common/src/Common/Internal/Resources.php +++ b/azure-storage-common/src/Common/Internal/Resources.php @@ -161,6 +161,7 @@ class Resources const X_MS_CLIENT_REQUEST_ID = 'x-ms-client-request-id'; const X_MS_CONTINUATION_LOCATION_MODE = 'x-ms-continuation-location-mode'; const X_MS_TYPE = 'x-ms-type'; + const X_MS_BLOB_TYPE = 'x-ms-blob-type'; const X_MS_CONTENT_LENGTH = 'x-ms-content-length'; const X_MS_CACHE_CONTROL = 'x-ms-cache-control'; const X_MS_CONTENT_TYPE = 'x-ms-content-type'; From f43a169e97dba82d9db91459179c2442280ffa80 Mon Sep 17 00:00:00 2001 From: Zach Bimson Date: Fri, 18 Jun 2021 16:24:29 +0100 Subject: [PATCH 2/4] Remove failing optional headers and add new blob header --- azure-storage-file/src/File/FileRestProxy.php | 32 ++++++++----------- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/azure-storage-file/src/File/FileRestProxy.php b/azure-storage-file/src/File/FileRestProxy.php index c5696522..c031bd0f 100644 --- a/azure-storage-file/src/File/FileRestProxy.php +++ b/azure-storage-file/src/File/FileRestProxy.php @@ -348,12 +348,13 @@ private function multiplePutRangeConcurrentAsync( $options = new PutFileRangeOptions(); } - $this->addOptionalQueryParam( - $queryParams, - Resources::QP_COMP, - 'range' + $this->addOptionalHeader( + $headers, + Resources::X_MS_BLOB_TYPE, + 'BlockBlob' ); + $this->addOptionalQueryParam( $queryParams, Resources::QP_TIMEOUT, @@ -398,11 +399,6 @@ private function multiplePutRangeConcurrentAsync( $chunkRange = new Range($start); $chunkRange->setLength($size); - $selfInstance->addOptionalHeader( - $headers, - Resources::X_MS_RANGE, - $chunkRange->getRangeString() - ); $this->addOptionalHeader( $headers, @@ -1603,6 +1599,12 @@ public function createFileAsync( 'file' ); + $this->addOptionalHeader( + $headers, + Resources::X_MS_BLOB_TYPE, + 'BlockBlob' + ); + $this->addOptionalQueryParam( $queryParams, Resources::QP_TIMEOUT, @@ -2245,9 +2247,9 @@ public function putFileRangeAsync( ); $this->addOptionalHeader( - $headers, - Resources::X_MS_RANGE, - $range->getRangeString() + $headers, + Resources::X_MS_BLOB_TYPE, + 'BlockBlob' ); $this->addOptionalHeader( @@ -2268,12 +2270,6 @@ public function putFileRangeAsync( $options->getContentMD5() ); - $this->addOptionalQueryParam( - $queryParams, - Resources::QP_COMP, - 'range' - ); - return $this->sendAsync( $method, $headers, From d0671e3874efe0d16aa74bf856d9b013b4592410 Mon Sep 17 00:00:00 2001 From: Zach Bimson Date: Fri, 18 Jun 2021 16:29:20 +0100 Subject: [PATCH 3/4] Fix tabbing --- azure-storage-file/src/File/FileRestProxy.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/azure-storage-file/src/File/FileRestProxy.php b/azure-storage-file/src/File/FileRestProxy.php index c031bd0f..d59f42ab 100644 --- a/azure-storage-file/src/File/FileRestProxy.php +++ b/azure-storage-file/src/File/FileRestProxy.php @@ -349,12 +349,10 @@ private function multiplePutRangeConcurrentAsync( } $this->addOptionalHeader( - $headers, - Resources::X_MS_BLOB_TYPE, - 'BlockBlob' + $headers, + Resources::X_MS_BLOB_TYPE, 'BlockBlob' ); - $this->addOptionalQueryParam( $queryParams, Resources::QP_TIMEOUT, From 360e6b9f65e1ebdfdfeb500c2a2c613e067404a3 Mon Sep 17 00:00:00 2001 From: Zach Bimson Date: Fri, 18 Jun 2021 16:33:46 +0100 Subject: [PATCH 4/4] Fix tabbing, again --- azure-storage-file/src/File/FileRestProxy.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/azure-storage-file/src/File/FileRestProxy.php b/azure-storage-file/src/File/FileRestProxy.php index d59f42ab..0174f9be 100644 --- a/azure-storage-file/src/File/FileRestProxy.php +++ b/azure-storage-file/src/File/FileRestProxy.php @@ -350,7 +350,8 @@ private function multiplePutRangeConcurrentAsync( $this->addOptionalHeader( $headers, - Resources::X_MS_BLOB_TYPE, 'BlockBlob' + Resources::X_MS_BLOB_TYPE, + 'BlockBlob' ); $this->addOptionalQueryParam( @@ -1598,9 +1599,9 @@ public function createFileAsync( ); $this->addOptionalHeader( - $headers, - Resources::X_MS_BLOB_TYPE, - 'BlockBlob' + $headers, + Resources::X_MS_BLOB_TYPE, + 'BlockBlob' ); $this->addOptionalQueryParam( @@ -2245,9 +2246,9 @@ public function putFileRangeAsync( ); $this->addOptionalHeader( - $headers, - Resources::X_MS_BLOB_TYPE, - 'BlockBlob' + $headers, + Resources::X_MS_BLOB_TYPE, + 'BlockBlob' ); $this->addOptionalHeader(