@jsforce/jsforce-node 3.9.2 → 3.9.3

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/lib/VERSION.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const _default: "3.9.2";
1
+ declare const _default: "3.9.3";
2
2
  export default _default;
package/lib/VERSION.js CHANGED
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = '3.9.2';
3
+ exports.default = '3.9.3';
package/lib/http-api.js CHANGED
@@ -157,7 +157,10 @@ class HttpApi extends events_1.EventEmitter {
157
157
  }
158
158
  const bodySize = (0, get_body_size_1.getBodySize)(request.body, headers);
159
159
  const cannotHaveBody = ['GET', 'HEAD', 'OPTIONS'].includes(request.method);
160
- if (!cannotHaveBody &&
160
+ // Don't set content-length in browsers as it's not allowed
161
+ const isBrowser = 'window' in globalThis || 'self' in globalThis;
162
+ if (!isBrowser &&
163
+ !cannotHaveBody &&
161
164
  !!request.body &&
162
165
  !('transfer-encoding' in headers) &&
163
166
  !('content-length' in headers) &&
@@ -225,7 +228,8 @@ class HttpApi extends events_1.EventEmitter {
225
228
  isSessionExpired(response) {
226
229
  // TODO:
227
230
  // The connected app msg only applies to Agent API requests, we should move this to a separate SFAP/Agent API class later.
228
- return response.statusCode === 401 && !response.body.includes('Connected app is not attached to Agent');
231
+ return (response.statusCode === 401 &&
232
+ !response.body.includes('Connected app is not attached to Agent'));
229
233
  }
230
234
  /**
231
235
  * Detect error response
@@ -289,7 +293,9 @@ class HttpApi extends events_1.EventEmitter {
289
293
  Check that the org exists and can be reached.
290
294
  See \`error.data\` for the full html response.`, error.errorCode, error.message);
291
295
  }
292
- return error instanceof HttpApiError ? error : new HttpApiError(error.message, error.errorCode, error);
296
+ return error instanceof HttpApiError
297
+ ? error
298
+ : new HttpApiError(error.message, error.errorCode, error);
293
299
  }
294
300
  }
295
301
  exports.HttpApi = HttpApi;
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "database.com"
11
11
  ],
12
12
  "homepage": "http://github.com/jsforce/jsforce",
13
- "version": "3.9.2",
13
+ "version": "3.9.3",
14
14
  "repository": {
15
15
  "type": "git",
16
16
  "url": "git://github.com/jsforce/jsforce.git"