Visitar URL original
feat: zstandard support by Phillip9587 · Pull Request #586 · expressjs/body-parser · GitHub
Skip to content

feat: zstandard support - #586

Merged
Phillip9587 merged 2 commits into
expressjs:masterfrom
Phillip9587:zstd
Aug 14, 2026
Merged

Phillip9587 merged 2 commits into
expressjs:masterfrom
Phillip9587:zstd

Conversation

@Phillip9587

@Phillip9587 Phillip9587 commented Feb 13, 2025 •

Copy link
Copy Markdown
Member

This PR introduces support for the Zstandard (Zstd) algorithm, which was released as an experimental feature in Node.js 23.8.0.

Key Changes

  • Adds support for Zstandard (Zstd) as an optional compression algorithm.

Notes

  • This feature is experimental and subject to changes in future Node.js releases.
  • Requires Node.js 23.8.0+ to function correctly.

closes #560

@bjohansebas bjohansebas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would really prefer to wait until the API becomes stable. This is the same stance I’m going to take with compression. There may be no changes during the transition from experimental to stable, but it’s better to use only stable APIs

Great job anyway!

@wesleytodd wesleytodd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, we should wait until it is stable then just enable support without an experimental phase.

@DienoX

DienoX commented Feb 11, 2026

Copy link
Copy Markdown

Isn't it that time already?

@Phillip9587

Copy link
Copy Markdown
Member Author

Zsdt is still experimental as of Node.js 25.6.1: https://nodejs.org/api/zlib.html#class-zlibzstddecompress

@Phillip9587

Copy link
Copy Markdown
Member Author

As @bjohansebas mentioned in expressjs/compression#250 (comment), several ecosystem packages have already adopted zstd. Should we revisit this discussion? Zstd was backported to Node.js v22.15.0, so once Node.js 20 LTS reaches EOL in April, all active LTS lines will include zstd support.

@Phillip9587

Copy link
Copy Markdown
Member Author

@UlisesGascon @jonchurch What are your opinions on this topic?

@Phillip9587

Copy link
Copy Markdown
Member Author

@UlisesGascon @wesleytodd All active LTS Node.js Versions now contain the Zstandard support. It is still experimental but already adopted by fastify in https://github.com/fastify/fastify-compress and by other ecosystem packages. I think we should also support it and document in which node.js versions zstd is available.

@Phillip9587
Phillip9587 force-pushed the zstd branch 2 times, most recently from 2e14960 to 6ad48c7 Compare May 13, 2026 18:23
@Phillip9587

Copy link
Copy Markdown
Member Author

Hey @jonchurch @UlisesGascon, Can I please get some feedback on this?

@bjohansebas bjohansebas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGMT!

@Phillip9587
Phillip9587 requested review from UlisesGascon, jonchurch and wesleytodd and removed request for UlisesGascon July 6, 2026 15:44
@Phillip9587

Copy link
Copy Markdown
Member Author

Hi @wesleytodd, @UlisesGascon, @jonchurch, could you please review this PR? I believe it would be great to get this moving. Thanks!

@Phillip9587

Copy link
Copy Markdown
Member Author

After asking for reviews since May 12 I'm just going to merge this now. We can still revert it if repo captains disagree

@Phillip9587
Phillip9587 merged commit b1f3d58 into expressjs:master Aug 14, 2026
17 checks passed
@Phillip9587
Phillip9587 deleted the zstd branch August 14, 2026 16:20
@UlisesGascon UlisesGascon mentioned this pull request Oct 21, 2026
markharding pushed a commit to futo-org/Harbor that referenced this pull request Oct 27, 2026
This PR contains the following updates:

| Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [body-parser](https://github.com/expressjs/body-parser) | [`2.3.0` → `2.4.0`](https://renovatebot.com/diffs/npm/body-parser/2.3.0/2.4.0) | ![age](https://developer.mend.io/api/mc/badges/age/npm/body-parser/2.4.0?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/body-parser/2.3.0/2.4.0?slim=true) |

---

> ⚠️ **Warning**
>
> Some dependencies could not be looked up. Check the [Dependency Dashboard](issues/99) for more information.

---

### Release Notes

<details>
<summary>expressjs/body-parser (body-parser)</summary>

### [`v2.4.0`](https://github.com/expressjs/body-parser/blob/HEAD/HISTORY.md#240)

[Compare Source](expressjs/body-parser@v2.3.0...v2.4.0)

\=====

- Security fix for [GHSA-27r3-jxmh-p828](GHSA-27r3-jxmh-p828) (CVE-2026-111181)
- feat: add `zstd` content-encoding support ([#&#8203;586](expressjs/body-parser#586))
  - Requires Node.js `^22.15.0` or `>=23.8.0`; older versions keep returning `415` for `zstd` encoded bodies
- fix: avoid mutating the parser options and the request object while reading the body ([#&#8203;742](expressjs/body-parser#742), [#&#8203;750](expressjs/body-parser#750))
- perf(json): avoid first-char regex for direct JSON bodies ([#&#8203;744](expressjs/body-parser#744))
- deps:
  - content-type@^2.1.0
  - iconv-lite^0.7.3
  - qs@^6.16.1

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - "before 9am on tuesday"
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xNzUuMSIsInVwZGF0ZWRJblZlciI6IjQ0LjE3NS4xIiwidGFyZ2V0QnJhbmNoIjoiZGV2ZWxvcCIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiLCJyZW5vdmF0ZSJdfQ==-->

Reviewed-on: https://code.futo.org/harbor/harbor/pulls/2043
markharding pushed a commit to futo-org/Harbor that referenced this pull request Oct 29, 2026
This PR contains the following updates:

| Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [body-parser](https://github.com/expressjs/body-parser) | [`2.3.0` → `2.4.0`](https://renovatebot.com/diffs/npm/body-parser/2.3.0/2.4.0) | ![age](https://developer.mend.io/api/mc/badges/age/npm/body-parser/2.4.0?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/body-parser/2.3.0/2.4.0?slim=true) |

---

> ⚠️ **Warning**
>
> Some dependencies could not be looked up. Check the [Dependency Dashboard](issues/99) for more information.

---

### Release Notes

<details>
<summary>expressjs/body-parser (body-parser)</summary>

### [`v2.4.0`](https://github.com/expressjs/body-parser/blob/HEAD/HISTORY.md#240)

[Compare Source](expressjs/body-parser@v2.3.0...v2.4.0)

\=====

- Security fix for [GHSA-27r3-jxmh-p828](GHSA-27r3-jxmh-p828) (CVE-2026-111181)
- feat: add `zstd` content-encoding support ([#&#8203;586](expressjs/body-parser#586))
  - Requires Node.js `^22.15.0` or `>=23.8.0`; older versions keep returning `415` for `zstd` encoded bodies
- fix: avoid mutating the parser options and the request object while reading the body ([#&#8203;742](expressjs/body-parser#742), [#&#8203;750](expressjs/body-parser#750))
- perf(json): avoid first-char regex for direct JSON bodies ([#&#8203;744](expressjs/body-parser#744))
- deps:
  - content-type@^2.1.0
  - iconv-lite^0.7.3
  - qs@^6.16.1

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - "before 9am on tuesday"
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xNzUuMSIsInVwZGF0ZWRJblZlciI6IjQ0LjE3NS4xIiwidGFyZ2V0QnJhbmNoIjoiZGV2ZWxvcCIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiLCJyZW5vdmF0ZSJdfQ==-->

Reviewed-on: https://code.futo.org/harbor/harbor/pulls/2043
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

zstd support?

4 participants