From 0c679645e734afbcd823933b4221e8657e65b2f8 Mon Sep 17 00:00:00 2001 From: SukkaW Date: Fri, 10 Jan 2025 00:42:04 +0800 Subject: [PATCH] Patch undici to workaround https://github.com/nodejs/undici/issues/3959 Not spec-compliant, might break a few things, but we will see --- package.json | 5 +++++ patches/undici.patch | 13 +++++++++++++ pnpm-lock.yaml | 15 ++++++++++----- 3 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 patches/undici.patch diff --git a/package.json b/package.json index 7c0338cc..854a744b 100644 --- a/package.json +++ b/package.json @@ -74,5 +74,10 @@ "packageManager": "pnpm@9.15.3", "resolutions": { "has": "npm:@nolyfill/has@latest" + }, + "pnpm": { + "patchedDependencies": { + "undici": "patches/undici.patch" + } } } diff --git a/patches/undici.patch b/patches/undici.patch new file mode 100644 index 00000000..3921e650 --- /dev/null +++ b/patches/undici.patch @@ -0,0 +1,13 @@ +diff --git a/lib/util/cache.js b/lib/util/cache.js +index 35c53512b2acea09657b888e42dbfd04e45d7dbe..6ebce36bf7f3c50d6afabe5b3ab0e692605403dd 100644 +--- a/lib/util/cache.js ++++ b/lib/util/cache.js +@@ -270,8 +270,6 @@ function parseVaryHeader (varyHeader, headers) { + + if (headers[trimmedHeader]) { + output[trimmedHeader] = headers[trimmedHeader] +- } else { +- return undefined + } + } + diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e0d200e0..5b4b0b15 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -7,6 +7,11 @@ settings: overrides: has: npm:@nolyfill/has@latest +patchedDependencies: + undici: + hash: eyidnukwfhrd7exzoydz2h5cfq + path: patches/undici.patch + importers: .: @@ -73,10 +78,10 @@ importers: version: 6.1.71 undici: specifier: ^7.2.1 - version: 7.2.1 + version: 7.2.1(patch_hash=eyidnukwfhrd7exzoydz2h5cfq) undici-cache-store-better-sqlite3: specifier: ^0.1.1 - version: 0.1.1(undici@7.2.1) + version: 0.1.1(undici@7.2.1(patch_hash=eyidnukwfhrd7exzoydz2h5cfq)) whoiser: specifier: ^1.18.0 version: 1.18.0 @@ -3749,14 +3754,14 @@ snapshots: typescript@5.7.3: {} - undici-cache-store-better-sqlite3@0.1.1(undici@7.2.1): + undici-cache-store-better-sqlite3@0.1.1(undici@7.2.1(patch_hash=eyidnukwfhrd7exzoydz2h5cfq)): dependencies: better-sqlite3: 11.7.2 - undici: 7.2.1 + undici: 7.2.1(patch_hash=eyidnukwfhrd7exzoydz2h5cfq) undici-types@6.20.0: {} - undici@7.2.1: {} + undici@7.2.1(patch_hash=eyidnukwfhrd7exzoydz2h5cfq): {} unique-filename@4.0.0: dependencies: