chargebee 3.24.0 → 3.24.1
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/CHANGELOG.md +10 -0
- package/cjs/RequestWrapper.js +1 -1
- package/cjs/environment.js +1 -1
- package/esm/RequestWrapper.js +1 -1
- package/esm/environment.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
### v3.24.1 (2026-06-03)
|
|
2
|
+
* * *
|
|
3
|
+
### Bug Fixes:
|
|
4
|
+
- Fixed `Content-Length` header being computed from the JavaScript string length (UTF-16 code units) instead of the UTF-8 byte length. Requests with non-ASCII payloads (e.g. accented characters, CJK, emoji) under-declared `Content-Length` and were rejected by Node's `fetch`/undici (≥ 7.26.0) with `Request body length does not match content-length header`. The header is now computed via `Buffer.byteLength(data, 'utf8')`. Resolves https://github.com/chargebee/chargebee-node/issues/119.
|
|
5
|
+
|
|
6
|
+
### Tests:
|
|
7
|
+
- ASCII form-urlencoded body — `Content-Length` matches the UTF-8 byte length of the serialized body.
|
|
8
|
+
- Multi-byte JSON body — `Content-Length` matches the UTF-8 byte length and is greater than the JS character count, ensuring the regression cannot return.
|
|
9
|
+
|
|
10
|
+
|
|
1
11
|
### v3.24.0 (2026-05-04)
|
|
2
12
|
* * *
|
|
3
13
|
### New Resources:
|
package/cjs/RequestWrapper.js
CHANGED
|
@@ -73,7 +73,7 @@ class RequestWrapper {
|
|
|
73
73
|
const requestHeaders = Object.assign({}, this.httpHeaders);
|
|
74
74
|
if (data && data.length) {
|
|
75
75
|
(0, util_js_1.extend)(true, requestHeaders, {
|
|
76
|
-
'Content-Length': data
|
|
76
|
+
'Content-Length': node_buffer_1.Buffer.byteLength(data, 'utf8'),
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
79
|
const contentType = this.apiCall.isJsonRequest
|
package/cjs/environment.js
CHANGED
|
@@ -11,7 +11,7 @@ exports.Environment = {
|
|
|
11
11
|
hostSuffix: '.chargebee.com',
|
|
12
12
|
apiPath: '/api/v2',
|
|
13
13
|
timeout: DEFAULT_TIME_OUT,
|
|
14
|
-
clientVersion: 'v3.24.
|
|
14
|
+
clientVersion: 'v3.24.1',
|
|
15
15
|
port: DEFAULT_PORT,
|
|
16
16
|
timemachineWaitInMillis: DEFAULT_TIME_MACHINE_WAIT,
|
|
17
17
|
exportWaitInMillis: DEFAULT_EXPORT_WAIT,
|
package/esm/RequestWrapper.js
CHANGED
|
@@ -70,7 +70,7 @@ export class RequestWrapper {
|
|
|
70
70
|
const requestHeaders = Object.assign({}, this.httpHeaders);
|
|
71
71
|
if (data && data.length) {
|
|
72
72
|
extend(true, requestHeaders, {
|
|
73
|
-
'Content-Length': data
|
|
73
|
+
'Content-Length': Buffer.byteLength(data, 'utf8'),
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
76
|
const contentType = this.apiCall.isJsonRequest
|
package/esm/environment.js
CHANGED
|
@@ -8,7 +8,7 @@ export const Environment = {
|
|
|
8
8
|
hostSuffix: '.chargebee.com',
|
|
9
9
|
apiPath: '/api/v2',
|
|
10
10
|
timeout: DEFAULT_TIME_OUT,
|
|
11
|
-
clientVersion: 'v3.24.
|
|
11
|
+
clientVersion: 'v3.24.1',
|
|
12
12
|
port: DEFAULT_PORT,
|
|
13
13
|
timemachineWaitInMillis: DEFAULT_TIME_MACHINE_WAIT,
|
|
14
14
|
exportWaitInMillis: DEFAULT_EXPORT_WAIT,
|