undici 5.26.0 → 5.26.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1200,6 +1200,10 @@ async function httpRedirectFetch (fetchParams, response) {
1200
1200
  if (!sameOrigin(requestCurrentURL(request), locationURL)) {
1201
1201
  // https://fetch.spec.whatwg.org/#cors-non-wildcard-request-header-name
1202
1202
  request.headersList.delete('authorization')
1203
+
1204
+ // "Cookie" and "Host" are forbidden request-headers, which undici doesn't implement.
1205
+ request.headersList.delete('cookie')
1206
+ request.headersList.delete('host')
1203
1207
  }
1204
1208
 
1205
1209
  // 14. If request’s body is non-null, then set request’s body to the first return
@@ -1344,7 +1348,7 @@ async function httpNetworkOrCacheFetch (
1344
1348
  // user agents should append `User-Agent`/default `User-Agent` value to
1345
1349
  // httpRequest’s header list.
1346
1350
  if (!httpRequest.headersList.contains('user-agent')) {
1347
- httpRequest.headersList.append('user-agent', __filename.endsWith('index.js') ? 'undici' : 'node')
1351
+ httpRequest.headersList.append('user-agent', typeof esbuildDetection === 'undefined' ? 'undici' : 'node')
1348
1352
  }
1349
1353
 
1350
1354
  // 15. If httpRequest’s cache mode is "default" and httpRequest’s header
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "undici",
3
- "version": "5.26.0",
3
+ "version": "5.26.2",
4
4
  "description": "An HTTP/1.1 client, written from scratch for Node.js",
5
5
  "homepage": "https://undici.nodejs.org",
6
6
  "bugs": {
@@ -70,7 +70,7 @@
70
70
  "docs"
71
71
  ],
72
72
  "scripts": {
73
- "build:node": "npx esbuild@0.14.38 index-fetch.js --bundle --platform=node --outfile=undici-fetch.js",
73
+ "build:node": "node scripts/esbuild-build.mjs",
74
74
  "prebuild:wasm": "node build/wasm.js --prebuild",
75
75
  "build:wasm": "node build/wasm.js --docker",
76
76
  "lint": "standard | snazzy",
@@ -109,6 +109,7 @@
109
109
  "delay": "^5.0.0",
110
110
  "dns-packet": "^5.4.0",
111
111
  "docsify-cli": "^4.4.3",
112
+ "esbuild": "^0.19.4",
112
113
  "form-data": "^4.0.0",
113
114
  "formdata-node": "^4.3.1",
114
115
  "https-pem": "^3.0.0",