apinow-sdk 0.11.7 → 0.11.9

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.
Files changed (2) hide show
  1. package/dist/index.js +4 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -159,6 +159,10 @@ class ApiNow {
159
159
  if (opts.data) {
160
160
  console.error(`txResponse: Setting data as body for ${method} request:`, opts.data);
161
161
  fetchOptions.body = JSON.stringify(opts.data);
162
+ // Explicitly set Content-Length
163
+ if (fetchOptions.headers && typeof fetchOptions.body === 'string') {
164
+ fetchOptions.headers['Content-Length'] = String(Buffer.byteLength(fetchOptions.body, 'utf-8'));
165
+ }
162
166
  }
163
167
  }
164
168
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apinow-sdk",
3
- "version": "0.11.7",
3
+ "version": "0.11.9",
4
4
  "description": "ApiNow SDK · The endpoint vending machine",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",