Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit d99015a

Browse files
committed
Remove default fetch headers added by undici, closes #139
Specifically, remove `Accept`, `Accept-Language`, `Sec-Fetch-Mode` and `User-Agent`, unless they are explicitly added by the user. `User-Agent` is particularly important to remove as many APIs (e.g. GitHub), require it to be set, meaning code was working locally but not when deployed. The implementation of this relies on some internal `undici` exports. We were already using some internal symbols for accessing hidden `Request`/`Response` state, so this isn't too bad. The version of `undici` is now pinned to an exact version though, so if internal changes are made, they shouldn't affect end-users. We'll have to explicitly upgrade and run our tests again.
1 parent 1bf7600 commit d99015a

File tree

10 files changed

+197
-59
lines changed

10 files changed

+197
-59
lines changed

package-lock.json

Lines changed: 47 additions & 45 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/cache/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"@miniflare/core": "2.0.0-rc.5",
3939
"@miniflare/shared": "2.0.0-rc.5",
4040
"http-cache-semantics": "^4.1.0",
41-
"undici": "^4.11.1"
41+
"undici": "4.12.1"
4242
},
4343
"devDependencies": {
4444
"@miniflare/shared-test": "2.0.0-rc.5",

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"dotenv": "^10.0.0",
4545
"kleur": "^4.1.4",
4646
"set-cookie-parser": "^2.4.8",
47-
"undici": "^4.11.1"
47+
"undici": "4.12.1"
4848
},
4949
"devDependencies": {
5050
"@miniflare/durable-objects": "2.0.0-rc.5",

0 commit comments

Comments
 (0)