@azure/storage-file-share 12.9.0-alpha.20220104.2 → 12.9.0-alpha.20220105.6

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
@@ -9229,9 +9229,16 @@ class StorageBrowserPolicy extends coreHttp.BaseRequestPolicy {
9229
9229
  * @param request -
9230
9230
  */
9231
9231
  async sendRequest(request) {
9232
- {
9232
+ if (coreHttp.isNode) {
9233
9233
  return this._nextPolicy.sendRequest(request);
9234
9234
  }
9235
+ if (request.method.toUpperCase() === "GET" || request.method.toUpperCase() === "HEAD") {
9236
+ request.url = setURLParameter(request.url, URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, new Date().getTime().toString());
9237
+ }
9238
+ request.headers.remove(HeaderConstants.COOKIE);
9239
+ // According to XHR standards, content-length should be fully controlled by browsers
9240
+ request.headers.remove(HeaderConstants.CONTENT_LENGTH);
9241
+ return this._nextPolicy.sendRequest(request);
9235
9242
  }
9236
9243
  }
9237
9244
 
@@ -9477,7 +9484,7 @@ class TelemetryPolicy extends coreHttp.BaseRequestPolicy {
9477
9484
  * @param request -
9478
9485
  */
9479
9486
  async sendRequest(request) {
9480
- {
9487
+ if (coreHttp.isNode) {
9481
9488
  if (!request.headers) {
9482
9489
  request.headers = new coreHttp.HttpHeaders();
9483
9490
  }
@@ -9500,7 +9507,7 @@ class TelemetryPolicyFactory {
9500
9507
  */
9501
9508
  constructor(telemetry) {
9502
9509
  const userAgentInfo = [];
9503
- {
9510
+ if (coreHttp.isNode) {
9504
9511
  if (telemetry) {
9505
9512
  const telemetryString = telemetry.userAgentPrefix || "";
9506
9513
  if (telemetryString.length > 0 && userAgentInfo.indexOf(telemetryString) === -1) {
@@ -9683,7 +9690,7 @@ function newPipeline(credential, pipelineOptions = {}) {
9683
9690
  allowedQueryParameters: StorageFileLoggingAllowedQueryParameters,
9684
9691
  }),
9685
9692
  ];
9686
- {
9693
+ if (coreHttp.isNode) {
9687
9694
  // policies only available in Node.js runtime, not in browsers
9688
9695
  factories.push(coreHttp.proxyPolicy(pipelineOptions.proxyOptions));
9689
9696
  factories.push(coreHttp.disableResponseDecompressionPolicy());
@@ -11169,11 +11176,14 @@ class ShareClient extends StorageClient {
11169
11176
  const extractedCreds = extractConnectionStringParts(urlOrConnectionString);
11170
11177
  const name = credentialOrPipelineOrShareName;
11171
11178
  if (extractedCreds.kind === "AccountConnString") {
11172
- {
11179
+ if (coreHttp.isNode) {
11173
11180
  const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey);
11174
11181
  url = appendToURLPath(extractedCreds.url, name);
11175
11182
  pipeline = newPipeline(sharedKeyCredential, options);
11176
11183
  }
11184
+ else {
11185
+ throw new Error("Account connection string is only supported in Node.js environment");
11186
+ }
11177
11187
  }
11178
11188
  else if (extractedCreds.kind === "SASConnString") {
11179
11189
  url = appendToURLPath(extractedCreds.url, name) + "?" + extractedCreds.accountSas;
@@ -13457,7 +13467,7 @@ class ShareFileClient extends StorageClient {
13457
13467
  async uploadData(data, options = {}) {
13458
13468
  const { span, updatedOptions } = createSpan("ShareFileClient-uploadData", options);
13459
13469
  try {
13460
- if (true) {
13470
+ if (coreHttp.isNode) {
13461
13471
  let buffer;
13462
13472
  if (data instanceof Buffer) {
13463
13473
  buffer = data;
@@ -14326,11 +14336,14 @@ class ShareServiceClient extends StorageClient {
14326
14336
  options) {
14327
14337
  const extractedCreds = extractConnectionStringParts(connectionString);
14328
14338
  if (extractedCreds.kind === "AccountConnString") {
14329
- {
14339
+ if (coreHttp.isNode) {
14330
14340
  const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey);
14331
14341
  const pipeline = newPipeline(sharedKeyCredential, options);
14332
14342
  return new ShareServiceClient(extractedCreds.url, pipeline);
14333
14343
  }
14344
+ else {
14345
+ throw new Error("Account connection string is only supported in Node.js environment");
14346
+ }
14334
14347
  }
14335
14348
  else if (extractedCreds.kind === "SASConnString") {
14336
14349
  const pipeline = newPipeline(new AnonymousCredential(), options);