A Fetch API Headers polyfill and transformation library that provides a `Headers` class for constructing and managing HTTP headers in non-browser environments. It also includes helpers to convert headers between `Headers`, strings, lists, and plain objects, preserving raw header names when needed.
Project status
- Actively maintained: Yes, based on the very recent upstream push on 2026-06-01 and follow-up tagged update on 2026-03-05 (v5.0.x), suggesting the project is still in active development rather than dormant.
- Update cadence: Tag cadence appears bursty but fairly recent, with v5.0.0 and v5.0.1 both in March 2026 (close together), followed by an upstream push in June 2026. Earlier versions show long gaps (for example, 2024 to 2026).
AI summary generated
Recent updates
v5.0.1
v5.0.1 is a small bug fix release for the headers-polyfill. It ensures the Headers constructor can accept a HeadersInit object created with a null prototype (Object.create(null)) without throwing.
v5.0.0
v5.0.0 modernizes the package build and test toolchain and introduces iterator disposal support intended to work with TypeScript 5.2. It also updates published entrypoints toward an ESM-first layout using conditional `exports`. Release notes call out esm-first and a TypeScript 5.2 disposable-method fix, but the diff shows additional packaging and compatibility changes that are not fully documented.
BreakingFeaturesv4.0.3
Release v4.0.3 primarily adds a [Symbol.toStringTag] property to the Headers polyfill so that Object.prototype.toString output matches what developers expect. The release notes only mention this change, and the code diff confirms it, with additional test and CI workflow adjustments.
v4.0.2
Release v4.0.2 is presented as a single bug fix related to interoperability with Undici 5.26.3. The code diff shows a change to how the Headers polyfill constructor detects “native” Headers-like inputs, plus CI and release workflow changes not mentioned in the release notes.
v4.0.1
v4.0.1 is labeled as a bug fix release, and the provided release notes only mention updating documentation around the getRawHeaders method. The actual diff shown modifies README.md and bumps the package version in package.json, with no library code changes visible in the diff.
v4.0.0
The v4.0.0 release notes are effectively empty (only reference issue #70). The actual code diff shows no functional source changes, only a package.json version bump and a minor formatting change (newline at end of file).
v3.3.0
v3.3.0 removes the Headers instance method .all() and replaces the .raw() method with a standalone getRawHeaders(headers) helper. The main public change is around how callers retrieve normalized vs raw header names, plus related refactoring in exports.
BreakingFeaturesv3.2.5
v3.2.5 adds validation for HTTP header names and header values. The implementation introduces new utility validators and updates `Headers` methods (`has`, `get`, `set`, `append`, `delete`) to reject invalid inputs.
v3.2.4
v3.2.4 updates the Headers polyfill iteration order for `.keys()`, `.values()`, and `.entries()` to return results sorted alphabetically. The implementation also changes how `set-cookie` headers are iterated, and that behavior flows through other iteration-based APIs like `forEach().`
v3.2.3
Release v3.2.3 updates the build output to target ES5, aligning with the stated goal of transpiling away from ES2020. The code diff also shows a build toolchain change by adding @swc/core to the devDependencies, which is not mentioned in the release notes.