chargebee 3.28.0 → 3.28.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 +9 -0
- package/cjs/RequestWrapper.js +0 -5
- package/cjs/environment.js +1 -1
- package/esm/RequestWrapper.js +0 -5
- package/esm/environment.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
### v3.28.1 (2026-07-16)
|
|
2
|
+
* * *
|
|
3
|
+
### Bug Fixes:
|
|
4
|
+
- Stopped setting the `Content-Length` header manually in `RequestWrapper`. `fetch`/undici already derives the correct value from the request `body`, so the manual header was redundant. When `FetchHttpClient` re-wraps the request (`new Request(request, { signal })`), some Node builds re-append the body-derived value, producing a comma-joined `"N, N"`. undici (>= 7.28) validates `Content-Length` with a strict all-digit check and rejects that value with `InvalidArgumentError: invalid content-length header`, failing the request before it reaches Chargebee. The header is now left to the platform. This is distinct from the value-correctness fix in v3.24.1 (issue #119). Verified on Node 18/20/22/24 and Cloudflare Workers (`workerd`), where the runtime emits the correct UTF-8 byte-length `Content-Length` on the wire.
|
|
5
|
+
|
|
6
|
+
### Tests:
|
|
7
|
+
- POST requests no longer set a `Content-Length` header on the outgoing `Request` (ASCII form-urlencoded and multi-byte JSON bodies), guarding against the duplicate-header regression while preserving body integrity.
|
|
8
|
+
|
|
9
|
+
|
|
1
10
|
### v3.28.0 (2026-06-30)
|
|
2
11
|
* * *
|
|
3
12
|
|
package/cjs/RequestWrapper.js
CHANGED
|
@@ -142,11 +142,6 @@ class RequestWrapper {
|
|
|
142
142
|
: (0, util_js_1.encodeParams)(requestParams, undefined, undefined, undefined, jsonKeys);
|
|
143
143
|
}
|
|
144
144
|
const requestHeaders = Object.assign(Object.assign({}, this.httpHeaders), telemetryHeaders);
|
|
145
|
-
if (data && data.length) {
|
|
146
|
-
(0, util_js_1.extend)(true, requestHeaders, {
|
|
147
|
-
'Content-Length': node_buffer_1.Buffer.byteLength(data, 'utf8'),
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
145
|
const contentType = this.apiCall.isJsonRequest
|
|
151
146
|
? 'application/json;charset=UTF-8'
|
|
152
147
|
: 'application/x-www-form-urlencoded; charset=utf-8';
|
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.28.
|
|
14
|
+
clientVersion: 'v3.28.1',
|
|
15
15
|
port: DEFAULT_PORT,
|
|
16
16
|
timemachineWaitInMillis: DEFAULT_TIME_MACHINE_WAIT,
|
|
17
17
|
exportWaitInMillis: DEFAULT_EXPORT_WAIT,
|
package/esm/RequestWrapper.js
CHANGED
|
@@ -139,11 +139,6 @@ export class RequestWrapper {
|
|
|
139
139
|
: encodeParams(requestParams, undefined, undefined, undefined, jsonKeys);
|
|
140
140
|
}
|
|
141
141
|
const requestHeaders = Object.assign(Object.assign({}, this.httpHeaders), telemetryHeaders);
|
|
142
|
-
if (data && data.length) {
|
|
143
|
-
extend(true, requestHeaders, {
|
|
144
|
-
'Content-Length': Buffer.byteLength(data, 'utf8'),
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
142
|
const contentType = this.apiCall.isJsonRequest
|
|
148
143
|
? 'application/json;charset=UTF-8'
|
|
149
144
|
: 'application/x-www-form-urlencoded; charset=utf-8';
|
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.28.
|
|
11
|
+
clientVersion: 'v3.28.1',
|
|
12
12
|
port: DEFAULT_PORT,
|
|
13
13
|
timemachineWaitInMillis: DEFAULT_TIME_MACHINE_WAIT,
|
|
14
14
|
exportWaitInMillis: DEFAULT_EXPORT_WAIT,
|