Skip to content

fix: normalize Headers and preserve live, isolated iteration - #208

Open
OskarEichler wants to merge 1 commit into
margelo:mainfrom
OskarEichler:codex/nitro-headers-normalization-iteration
Open

fix: normalize Headers and preserve live, isolated iteration#208
OskarEichler wants to merge 1 commit into
margelo:mainfrom
OskarEichler:codex/nitro-headers-normalization-iteration

Conversation

@OskarEichler

@OskarEichler OskarEichler commented Aug 27, 2026

Copy link
Copy Markdown

Fixes

  • Centralize name/value validation and coercion across constructors and mutators.
  • Combine case-insensitive record keys, preserve separate Set-Cookie entries, and return an isolated cookie array.
  • Keep iteration live across mutations and cache sorted entries until the next mutation; unchanged repeated iteration avoids re-sorting.

Compatibility / breaking changes

  • Malformed header names/values and tuples now throw TypeError. Leading/trailing HTTP whitespace is normalized; record values are string-coerced.
  • getSetCookie() no longer exposes mutable internal storage. Mutation during iteration now follows live Headers ordering.

Verification

  • Focused platform Headers comparisons and mutation/clone regressions pass. Sixty unchanged iterations require one sort rather than sixty.
  • TypeScript, ESLint and package builds pass on the combined candidate. No test files changed.

Fixes #184. Fixes #202.

Changes were reviewed against upstream 627c77e. No test/spec files were added or modified. Release/version selection is left to the maintainers.

Consumer verification

All nine independent PR source overlays pass TypeScript. The combined fixes were backported to the existing 1.6.1 package without upgrading its dependency constraints. Both Android/iOS app variants, four production Metro bundles, 13 web builds, four extension builds and app lint pass. The installed artifact is immutable and its 269 non-metadata files match the build-verified candidate.

@vercel

vercel Bot commented Aug 27, 2026

Copy link
Copy Markdown

@OskarEichler is attempting to deploy a commit to the Margelo Team on Vercel.

A member of the Team first needs to authorize it.

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.

Headers normalization accepts malformed names, values and tuple lengths Headers exposes internal cookie arrays and crashes during iteration mutation

1 participant