@azure/storage-blob 12.24.0-beta.1 → 12.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -91,8 +91,8 @@ class BaseRequestPolicy {
91
91
 
92
92
  // Copyright (c) Microsoft Corporation.
93
93
  // Licensed under the MIT license.
94
- const SDK_VERSION = "12.24.0-beta.1";
95
- const SERVICE_VERSION = "2024-05-04";
94
+ const SDK_VERSION = "12.24.0";
95
+ const SERVICE_VERSION = "2024-08-04";
96
96
  const BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES = 256 * 1024 * 1024; // 256MB
97
97
  const BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES = 4000 * 1024 * 1024; // 4000MB
98
98
  const BLOCK_BLOB_MAX_BLOCKS = 50000;
@@ -1996,6 +1996,32 @@ class StorageBrowserPolicyFactory {
1996
1996
  }
1997
1997
  }
1998
1998
 
1999
+ // Copyright (c) Microsoft Corporation.
2000
+ // Licensed under the MIT license.
2001
+ /**
2002
+ * The programmatic identifier of the storageCorrectContentLengthPolicy.
2003
+ */
2004
+ const storageCorrectContentLengthPolicyName = "StorageCorrectContentLengthPolicy";
2005
+ /**
2006
+ * storageCorrectContentLengthPolicy to correctly set Content-Length header with request body length.
2007
+ */
2008
+ function storageCorrectContentLengthPolicy() {
2009
+ function correctContentLength(request) {
2010
+ if (request.body &&
2011
+ (typeof request.body === "string" || Buffer.isBuffer(request.body)) &&
2012
+ request.body.length > 0) {
2013
+ request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body));
2014
+ }
2015
+ }
2016
+ return {
2017
+ name: storageCorrectContentLengthPolicyName,
2018
+ async sendRequest(request, next) {
2019
+ correctContentLength(request);
2020
+ return next(request);
2021
+ },
2022
+ };
2023
+ }
2024
+
1999
2025
  // Copyright (c) Microsoft Corporation.
2000
2026
  // Licensed under the MIT license.
2001
2027
  /**
@@ -2125,6 +2151,7 @@ function getCoreClientOptions(pipeline) {
2125
2151
  } }));
2126
2152
  corePipeline.removePolicy({ phase: "Retry" });
2127
2153
  corePipeline.removePolicy({ name: coreRestPipeline.decompressResponsePolicyName });
2154
+ corePipeline.addPolicy(storageCorrectContentLengthPolicy());
2128
2155
  corePipeline.addPolicy(storageRetryPolicy(restOptions.retryOptions), { phase: "Retry" });
2129
2156
  corePipeline.addPolicy(storageBrowserPolicy());
2130
2157
  const downlevelResults = processDownlevelPipeline(pipeline);
@@ -15344,7 +15371,7 @@ let StorageClient$1 = class StorageClient extends coreHttpCompat__namespace.Exte
15344
15371
  const defaults = {
15345
15372
  requestContentType: "application/json; charset=utf-8",
15346
15373
  };
15347
- const packageDetails = `azsdk-js-azure-storage-blob/12.24.0-beta.1`;
15374
+ const packageDetails = `azsdk-js-azure-storage-blob/12.24.0`;
15348
15375
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
15349
15376
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
15350
15377
  : `${packageDetails}`;