Skip to content

Releasing v3.28.1.#126

Merged
cb-alish merged 2 commits into
masterfrom
release-v3.28.1
Jul 16, 2026
Merged

Releasing v3.28.1.#126
cb-alish merged 2 commits into
masterfrom
release-v3.28.1

Conversation

@cb-alish

@cb-alish cb-alish commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

v3.28.1 (2026-07-16)


Bug Fixes:

  • 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 Content-Length request header is set to the string character count instead of the UTF-8 byte length → TypeError: fetch failed on any non-ASCII request body #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.

Tests:

  • 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.

Resolves: #125

Bumps to v3.28.1 by removing manual Content-Length computation in RequestWrapper so fetch/undici derives it from the body, avoiding invalid duplicate/comma-joined values. Adds/adjusts tests for ASCII form-urlencoded and multibyte JSON POSTs to confirm payload integrity and that Content-Length isn’t set (null). Fixes #125.

@cb-alish
cb-alish requested a review from cb-karthikp July 16, 2026 07:04
@snyk-io

snyk-io Bot commented Jul 16, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues
Secrets 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: ff26edc3-03ff-484b-b640-9c90d3047e61

📥 Commits

Reviewing files that changed from the base of the PR and between e29d728 and 3852fb8.

📒 Files selected for processing (1)
  • src/RequestWrapper.ts
💤 Files with no reviewable changes (1)
  • src/RequestWrapper.ts

Walkthrough

RequestWrapper no longer manually sets Content-Length; regression tests cover form-urlencoded and multi-byte JSON requests. Release metadata, client version, and changelog entries are updated to v3.28.1.

Changes

Content-Length handling

Layer / File(s) Summary
Remove manual Content-Length handling and update regression tests
src/RequestWrapper.ts, test/requestWrapper.test.ts
Request construction delegates Content-Length derivation to fetch/undici, while tests require the outgoing header to be absent for form-urlencoded and multi-byte JSON bodies.
Publish v3.28.1
VERSION, package.json, src/environment.ts, CHANGELOG.md
Release metadata and changelog entries are updated from v3.28.0 to v3.28.1.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related issues

  • chargebee/chargebee-node#125 — Directly addresses the manual Content-Length behavior and adds regression coverage.

Suggested reviewers: cb-srinaths

🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

Comment @coderabbitai help to get the list of available commands.

@cb-alish
cb-alish requested a review from cb-srinaths July 16, 2026 07:04
Comment thread src/RequestWrapper.ts Outdated
@cb-alish
cb-alish merged commit 6d7e86b into master Jul 16, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants