-
Notifications
You must be signed in to change notification settings - Fork 126
feat: upgrade to undici@8 #820
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
a06df01
ccc6ef9
ac143d3
b6d10ab
f2dfc9a
65ac925
14acd12
e8c1c98
44ef14a
3d04056
9cf39ef
67a0c59
7a2a1a7
9424b74
d484db3
a9a0b2b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -121,7 +121,9 @@ describe('HttpClient.test.ts', () => { | |
| httpClient.request(_url), | ||
| ]); | ||
| // console.log(httpClient.getDispatcherPoolStats()); | ||
| assert.equal(httpClient.getDispatcherPoolStats()['https://registry.npmmirror.com'].connected, 4); | ||
| // undici@8 negotiates HTTP/2 with h2-capable servers, so all requests are | ||
| // multiplexed over a single connection instead of opening one per request. | ||
| assert.equal(httpClient.getDispatcherPoolStats()['https://registry.npmmirror.com'].connected, 1); | ||
| assert(httpClient.getDispatcherPoolStats()[_url.substring(0, _url.length - 1)].connected > 1); | ||
|
Comment on lines
+158
to
161
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The test Because of the bug in We should add an assertion to verify that |
||
| }); | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this upgrade, omitting
allowH2now means HTTP/2 is enabled by default, but the sameClientOptionstype is also used byFetchFactory.setClientOptions(): when callers pass only{ allowH2: false },src/fetch.tsstill checksclientOptions?.allowH2truthily and constructs aBaseAgentwithout the option, so undici v8 negotiates HTTP/2 anyway. This leaves fetch users without the documented HTTP/1.1 opt-out unless they also provideconnect/lookupor a custom dispatcher.Useful? React with 👍 / 👎.