Skip to content

Conversation

@alexandredev3
Copy link

This PR synchronizes SuperHeaders with the parent Headers class to ensure compatibility with Bun.

Previously, SuperHeaders stored data only in its internal #map without updating the parent Headers state. As a result, when running on Bun, the Response constructor would receive empty headers.

This appears to be because Bun accesses the parent Headers class's internal storage directly, bypassing overridden methods. Other runtimes, such as Node.js, seem to rely on JavaScript-level methods like entries(), which is why they behaved correctly.

The most reliable solution found was to explicitly call methods like super.append, super.set, and super.delete alongside the internal updates to make Headers state visible to Bun.

resolves #10872

@MichaelDeBoey MichaelDeBoey changed the title Sync super headers with native headers feat(headers): sync super headers with native headers Dec 13, 2025
@MichaelDeBoey MichaelDeBoey changed the title feat(headers): sync super headers with native headers feat(headers): sync SuperHeaders with native Headers Dec 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[headers] SuperHeaders not compatible with Bun's Response constructor

2 participants