GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: preserve HTTP/2 for non-upgrade legacy requests by mcollina · Pull Request #5811 · nodejs/undici

Conversation

@mcollina

@mcollina mcollina commented Sep 13, 2026

Copy link
Copy Markdown
Member

Summary

  • restrict the legacy dispatcher HTTP/1.1 compatibility override to upgrade requests
  • allow Node.js built-in fetch() to negotiate HTTP/2 through an Undici v8 global dispatcher
  • keep the native WebSocket fallback on HTTP/1.1 and assert its negotiated protocol
  • add an HTTP/2-only server regression fixture for built-in fetch()

Why

Dispatcher1Wrapper currently forces allowH2: false for every request. On Node.js versions whose built-in fetch consumes undici.globalDispatcher.1, this prevents a configured Undici v8 dispatcher from reaching servers that only advertise h2 through ALPN.

The override was introduced for legacy WebSocket consumers that cannot retry with HTTP/1.1 when HTTP/2 Extended CONNECT is unavailable. Scoping it to upgrade requests preserves that workaround without changing the protocol for ordinary fetch traffic.

Refs: #4989 and #4990.

Tests

  • npm run lint
  • npx borp -p "test/node-test/global-dispatcher-version.js" on Node.js 22.22.1, 24.18.1, and 26.8.1
  • npx borp -p "test/websocket/issue-4989.js" on Node.js 22.22.1, 24.18.1, and 26.8.1
  • npm run test:unit (one unrelated high-concurrency failure in test/issue-4880.js; isolated rerun passed)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mcollina
fix: preserve HTTP/2 for legacy fetch consumers
584ca8b
@codecov-commenter

codecov-commenter commented Sep 13, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.48%. Comparing base (cb7373a) to head (584ca8b).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5811      +/-   ##
==========================================
- Coverage   93.52%   93.48%   -0.05%     
==========================================
  Files         110      110              
  Lines       39415    39522     +107     
==========================================
+ Hits        36864    36947      +83     
- Misses       2551     2575      +24     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mcollina
mcollina requested review from metcoder95 and ronag September 13, 2026 19:29
metcoder95
metcoder95 approved these changes Sep 14, 2026
View reviewed changes
@mcollina
mcollina merged commit 073c88f into main Sep 14, 2026
38 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@mcollina
mcollina deleted the fix/legacy-dispatcher-http2 branch September 14, 2026 14:08
@github-actions github-actions Bot mentioned this pull request Sep 14, 2026
[Release] v8.11.0 #5821
Closed
This was referenced Sep 21, 2026
[Release] v8.11.0 #5848
Closed
[Release] v8.11.0 #5849
Merged
@mcollina mcollina mentioned this pull request Sep 22, 2026
Revert "fix: preserve HTTP/2 for legacy fetch consumers" #5860
Merged
@MiwiDots MiwiDots mentioned this pull request Sep 23, 2026
undici 8.11.0 breaks embedded undici #5858
Closed
This was referenced Sep 23, 2026
8.11.0: native Node fetch loses HTTP/2 headers and fails to decode compressed responses #5865
Closed
fix: normalize HTTP/2 headers for legacy dispatch handlers #5866
Closed
fix: normalize HTTP/2 headers for legacy dispatch handlers #5867
Merged
mcollina added a commit that referenced this pull request Sep 23, 2026
@mcollina
Revert "fix: preserve HTTP/2 for legacy fetch consumers" (#5860)
1d4ea0a
* Revert "fix: preserve HTTP/2 for legacy fetch consumers (#5811)"

This reverts commit 073c88f.

Signed-off-by: Matteo Collina <[email protected]>

* test: cover global fetch redirects after undici import

Signed-off-by: Matteo Collina <[email protected]>

---------

Signed-off-by: Matteo Collina <[email protected]>
AngeloSha added a commit to AngeloSha/uchiyomi that referenced this pull request Sep 25, 2026
@AngeloSha @claude
Catch an undici bump that leaves every source's answers compressed
a90a3dc
Dependabot #96 (undici 8.10.2 -> 8.11.0) keeps HTTP/2 for requests from Node's
bundled fetch (nodejs/undici#5811), and on HTTP/2 the content-encoding never
reaches that fetch: MangaDex's gzip body arrived as raw bytes, r.json() threw,
and every built-in source would have come back empty. Only the desktop's
MangaDex smoke saw it, as "latest 200, 0 candidates" -- the line a
rate-limited runner prints. This test reproduces it locally (HTTPS offering
HTTP/2, a gzipped answer, the undici package loaded as the app loads it):
green on 8.10.2, red on 8.11.0 with "still compressed (over HTTP 2.0)".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@zfy0701 zfy0701 mentioned this pull request Sep 25, 2026
fix(deps): bump undici to 8.11.2 so native fetch decodes responses again agentconnect-md/agentconnect#2514
Merged
@AngeloSha AngeloSha mentioned this pull request Oct 17, 2026
v0.78.1: Security fixes AngeloSha/uchiyomi#290
Merged
@delbyte delbyte mentioned this pull request Nov 4, 2026
fix(deps): bump undici and postcss-selector-parser pins withzeusai/app-template#182
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@metcoder95 metcoder95 metcoder95 approved these changes
@ronag ronag Awaiting requested review from ronag

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@mcollina @codecov-commenter @metcoder95
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.