$ the-wire · showcase
Undici tightens cache revalidation and proxy TLS routing
By RepoJournal · Filed · About Node.js · Composed from the cited sources · methodology
Undici closed two classes of quiet correctness bugs, stale background 304s served under the wrong validator or Vary header, and proxy routes silently dropping the target's TLS options, while its CI on main has been red since the runners moved to Node.js 26.14.0.
fix(cache): reject background 304 revalidation with a mismatched ETag nodejs/undici
A background stale-while-revalidate 304 whose ETag differed from the cached representation was accepted and its metadata merged around the old body, so a later caller could be served stale content under a foreign validator and freshness policy. The background path now mirrors the synchronous revalidation guard and compares validators before reusing the body.
fix(cache): don't refresh a stale entry when a background 304 changes Vary nodejs/undici
The same background path re-stored a stale entry on a 304 without checking that the 304 still described the stored response. It now drops the entry instead of refreshing it when the 304 adds or removes a Vary field, or when the response came from a redirect target rather than the cached URL.
fix(env-http-proxy-agent): apply target TLS options on every route nodejs/undici
The direct Agent used with no proxy or a NO_PROXY match never received requestTls options, and on proxied routes the target's TLS options given through connect or the deprecated top-level tls option only reached the direct Agent. Target TLS options now apply on every route, including http://, https:// and socks5:// proxies.
fix(proxy-agent): don't write credentials into the caller's headers nodejs/undici
ProxyAgent wrote proxy-authorization directly onto the caller's headers object, so other agents sharing it sent those credentials to their own proxy, and EnvHttpProxyAgent leaked one proxy's credentials to the other whenever headers was set. Headers are now copied before the credentials are added.
test: fix tests broken by Node.js 26.14.0 nodejs/undici
The long tail: CI on main has been red since the runners moved to Node.js 26.14.0, with the Node 26 macOS and Windows jobs timing out after 30 minutes and the --without-intl build cancelled after 2.5 hours; three unit test files fail and then hang test:unit on a tspl plan that never completes.