GeezerVison is showing github.com — deps: update undici to 7.6.0 · nodejs/node@c377394
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: deps/undici/src/docs/docs/api/Agent.md +1-1Lines changed: 1 addition & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
| 2 | 2 |
| 3 | 3 | Extends: `undici.Dispatcher` | 4 | 4 |
| 5 | | -Agent allow dispatching requests against multiple different origins. | | 5 | +Agent allows dispatching requests against multiple different origins. | 6 | 6 |
| 7 | 7 | Requests are not guaranteed to be dispatched in order of invocation. | 8 | 8 |
| |
Collapse file Copy file name to clipboardExpand all lines: deps/undici/src/lib/core/util.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -13,7 +13,7 @@ const { InvalidArgumentError } = require('./errors') | 13 | 13 | const { headerNameLowerCasedRecord } = require('./constants') | 14 | 14 | const { tree } = require('./tree') | 15 | 15 |
| 16 | | -const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(v => Number(v)) | | 16 | +const [nodeMajor, nodeMinor] = process.versions.node.split('.', 2).map(v => Number(v)) | 17 | 17 |
| 18 | 18 | class BodyAsyncIterable { | 19 | 19 | constructor (body) { | |
Collapse file Copy file name to clipboardExpand all lines: deps/undici/src/lib/handler/cache-revalidation-handler.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -9,7 +9,7 @@ const assert = require('node:assert') | 9 | 9 | * here, which we then just pass on to the next handler (most likely a | 10 | 10 | * CacheHandler). Note that this assumes the proper headers were already | 11 | 11 | * included in the request to tell the origin that we want to revalidate the | 12 | | - * response (i.e. if-modified-since). | | 12 | + * response (i.e. if-modified-since or if-none-match). | 13 | 13 | * | 14 | 14 | * @see https://www.rfc-editor.org/rfc/rfc9111.html#name-validation | 15 | 15 | * | |
Collapse file Copy file name to clipboardExpand all lines: deps/undici/src/lib/interceptor/cache.js +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -6,7 +6,7 @@ const util = require('../core/util') | 6 | 6 | const CacheHandler = require('../handler/cache-handler') | 7 | 7 | const MemoryCacheStore = require('../cache/memory-cache-store') | 8 | 8 | const CacheRevalidationHandler = require('../handler/cache-revalidation-handler') | 9 | | -const { assertCacheStore, assertCacheMethods, makeCacheKey, parseCacheControlHeader } = require('../util/cache.js') | | 9 | +const { assertCacheStore, assertCacheMethods, makeCacheKey, normaliseHeaders, parseCacheControlHeader } = require('../util/cache.js') | 10 | 10 | const { AbortError } = require('../core/errors.js') | 11 | 11 |
| 12 | 12 | /** | @@ -221,7 +221,7 @@ function handleResult ( | 221 | 221 | // Check if the response is stale | 222 | 222 | if (needsRevalidation(result, reqCacheControl)) { | 223 | 223 | if (util.isStream(opts.body) && util.bodyLength(opts.body) !== 0) { | 224 | | - // If body is is stream we can't revalidate... | | 224 | + // If body is a stream we can't revalidate... | 225 | 225 | // TODO (fix): This could be less strict... | 226 | 226 | return dispatch(opts, new CacheHandler(globalOpts, cacheKey, handler)) | 227 | 227 | } | @@ -233,7 +233,7 @@ function handleResult ( | 233 | 233 | } | 234 | 234 |
| 235 | 235 | let headers = { | 236 | | - ...opts.headers, | | 236 | + ...normaliseHeaders(opts), | 237 | 237 | 'if-modified-since': new Date(result.cachedAt).toUTCString() | 238 | 238 | } | 239 | 239 |
| |
Collapse file Copy file name to clipboardExpand all lines: deps/undici/src/lib/llhttp/wasm_build_env.txt +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 |
| 2 | | -> undici@7.5.0 build:wasm | | 2 | +> undici@7.6.0 build:wasm | 3 | 3 | > node build/wasm.js --docker | 4 | 4 |
| 5 | 5 | > docker run --rm --platform=linux/x86_64 --user 1001:118 --mount type=bind,source=/home/runner/work/node/node/deps/undici/src/lib/llhttp,target=/home/node/build/lib/llhttp --mount type=bind,source=/home/runner/work/node/node/deps/undici/src/build,target=/home/node/build/build --mount type=bind,source=/home/runner/work/node/node/deps/undici/src/deps,target=/home/node/build/deps -t ghcr.io/nodejs/wasm-builder@sha256:975f391d907e42a75b8c72eb77c782181e941608687d4d8694c3e9df415a0970 node build/wasm.js | |
Collapse file Copy file name to clipboardExpand all lines: deps/undici/src/lib/mock/mock-utils.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -97,7 +97,7 @@ function safeUrl (path) { | 97 | 97 | return path | 98 | 98 | } | 99 | 99 |
| 100 | | - const pathSegments = path.split('?') | | 100 | + const pathSegments = path.split('?', 3) | 101 | 101 |
| 102 | 102 | if (pathSegments.length !== 2) { | 103 | 103 | return path | |
Collapse file Copy file name to clipboardExpand all lines: deps/undici/src/lib/util/cache.js +17-7Lines changed: 17 additions & 7 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -12,7 +12,21 @@ function makeCacheKey (opts) { | 12 | 12 | throw new Error('opts.origin is undefined') | 13 | 13 | } | 14 | 14 |
| 15 | | - /** @type {Record<string, string[] | string>} */ | | 15 | + const headers = normaliseHeaders(opts) | | 16 | + | | 17 | + return { | | 18 | + origin: opts.origin.toString(), | | 19 | + method: opts.method, | | 20 | + path: opts.path, | | 21 | + headers | | 22 | + } | | 23 | +} | | 24 | + | | 25 | +/** | | 26 | + * @param {Record<string, string[] | string>} | | 27 | + * @return {Record<string, string[] | string>} | | 28 | + */ | | 29 | +function normaliseHeaders (opts) { | 16 | 30 | let headers | 17 | 31 | if (opts.headers == null) { | 18 | 32 | headers = {} | @@ -38,12 +52,7 @@ function makeCacheKey (opts) { | 38 | 52 | throw new Error('opts.headers is not an object') | 39 | 53 | } | 40 | 54 |
| 41 | | - return { | 42 | | - origin: opts.origin.toString(), | 43 | | - method: opts.method, | 44 | | - path: opts.path, | 45 | | - headers | 46 | | - } | | 55 | + return headers | 47 | 56 | } | 48 | 57 |
| 49 | 58 | /** | @@ -350,6 +359,7 @@ function assertCacheMethods (methods, name = 'CacheMethods') { | 350 | 359 |
| 351 | 360 | module.exports = { | 352 | 361 | makeCacheKey, | | 362 | + normaliseHeaders, | 353 | 363 | assertCacheKey, | 354 | 364 | assertCacheValue, | 355 | 365 | parseCacheControlHeader, | |
Collapse file Copy file name to clipboardExpand all lines: deps/undici/src/lib/web/fetch/index.js +4-3Lines changed: 4 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -309,7 +309,9 @@ function finalizeAndReportTiming (response, initiatorType = 'other') { | 309 | 309 | originalURL.href, | 310 | 310 | initiatorType, | 311 | 311 | globalThis, | 312 | | - cacheState | | 312 | + cacheState, | | 313 | + '', // bodyType | | 314 | + response.status | 313 | 315 | ) | 314 | 316 | } | 315 | 317 |
| @@ -994,7 +996,7 @@ function fetchFinale (fetchParams, response) { | 994 | 996 | // 3. Set fetchParams’s controller’s report timing steps to the following steps given a global object global: | 995 | 997 | fetchParams.controller.reportTimingSteps = () => { | 996 | 998 | // 1. If fetchParams’s request’s URL’s scheme is not an HTTP(S) scheme, then return. | 997 | | - if (fetchParams.request.url.protocol !== 'https:') { | | 999 | + if (!urlIsHttpHttpsScheme(fetchParams.request.url)) { | 998 | 1000 | return | 999 | 1001 | } | 1000 | 1002 |
| @@ -1036,7 +1038,6 @@ function fetchFinale (fetchParams, response) { | 1036 | 1038 | // fetchParams’s request’s URL, fetchParams’s request’s initiator type, global, cacheState, bodyInfo, | 1037 | 1039 | // and responseStatus. | 1038 | 1040 | if (fetchParams.request.initiatorType != null) { | 1039 | | - // TODO: update markresourcetiming | 1040 | 1041 | markResourceTiming(timingInfo, fetchParams.request.url.href, fetchParams.request.initiatorType, globalThis, cacheState, bodyInfo, responseStatus) | 1041 | 1042 | } | 1042 | 1043 | } | |
Collapse file Copy file name to clipboardExpand all lines: deps/undici/src/lib/web/websocket/util.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -206,7 +206,7 @@ function parseExtensions (extensions) { | 206 | 206 |
| 207 | 207 | while (position.position < extensions.length) { | 208 | 208 | const pair = collectASequenceOfCodePointsFast(';', extensions, position) | 209 | | - const [name, value = ''] = pair.split('=') | | 209 | + const [name, value = ''] = pair.split('=', 2) | 210 | 210 |
| 211 | 211 | extensionList.set( | 212 | 212 | removeHTTPWhitespace(name, true, false), | |
|