Browse Source

Patch undici to workaround https://github.com/nodejs/undici/issues/3959

Not spec-compliant, might break a few things, but we will see
SukkaW 1 year ago
parent
commit
0c679645e7
3 changed files with 28 additions and 5 deletions
  1. 5 0
      package.json
  2. 13 0
      patches/undici.patch
  3. 10 5
      pnpm-lock.yaml

+ 5 - 0
package.json

@@ -74,5 +74,10 @@
   "packageManager": "pnpm@9.15.3",
   "resolutions": {
     "has": "npm:@nolyfill/has@latest"
+  },
+  "pnpm": {
+    "patchedDependencies": {
+      "undici": "patches/undici.patch"
+    }
   }
 }

+ 13 - 0
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
+     }
+   }
+ 

+ 10 - 5
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: