Skip to content

Commit

Permalink
Revert "feat: upgrade to undici v7 (#547)"
Browse files Browse the repository at this point in the history
This reverts commit 9803c4e.
  • Loading branch information
fengmk2 committed Nov 30, 2024
1 parent e030ec9 commit cbf75b6
Show file tree
Hide file tree
Showing 19 changed files with 98 additions and 498 deletions.
34 changes: 0 additions & 34 deletions examples/h2-other-side-closed-exit-0-fetch.cjs

This file was deleted.

34 changes: 0 additions & 34 deletions examples/h2-other-side-closed-exit-0.cjs

This file was deleted.

49 changes: 0 additions & 49 deletions examples/longruning.cjs

This file was deleted.

4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,11 @@
"prepublishOnly": "npm run build"
},
"dependencies": {
"form-data": "^4.0.1",
"formstream": "^1.5.1",
"mime-types": "^2.1.35",
"qs": "^6.12.1",
"type-fest": "^4.20.1",
"undici": "^7.0.0",
"undici": "^6.19.2",
"ylru": "^2.0.0"
},
"devDependencies": {
Expand All @@ -69,7 +68,6 @@
"cross-env": "^7.0.3",
"eslint": "8",
"eslint-config-egg": "14",
"https-pem": "^3.0.0",
"iconv-lite": "^0.6.3",
"proxy": "^1.0.2",
"selfsigned": "^2.0.1",
Expand Down
5 changes: 2 additions & 3 deletions scripts/replace_urllib_version.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ async function main() {
for (const file of files) {
const content = await fs.readFile(file, 'utf-8');
// replace "const VERSION = 'VERSION';" to "const VERSION = '4.0.0';"
// "exports.VERSION = 'VERSION';" => "exports.VERSION = '4.0.0';"
const newContent = content.replace(/ = 'VERSION';/, match => {
const after = ` = '${pkg.version}';`;
const newContent = content.replace(/const VERSION = 'VERSION';/, match => {
const after = `const VERSION = '${pkg.version}';`;
console.log('[%s] %s => %s', file, match, after);
return after;
});
Expand Down
2 changes: 1 addition & 1 deletion src/FetchOpaqueInterceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export interface OpaqueInterceptorOptions {
export function fetchOpaqueInterceptor(opts: OpaqueInterceptorOptions) {
const opaqueLocalStorage = opts?.opaqueLocalStorage;
return (dispatch: Dispatcher['dispatch']): Dispatcher['dispatch'] => {
return function redirectInterceptor(opts: Dispatcher.DispatchOptions, handler: Dispatcher.DispatchHandler) {
return function redirectInterceptor(opts: Dispatcher.DispatchOptions, handler: Dispatcher.DispatchHandlers) {
const opaque = opaqueLocalStorage?.getStore();
(handler as any).opaque = opaque;
return dispatch(opts, handler);
Expand Down
32 changes: 0 additions & 32 deletions src/FormData.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/HttpAgent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class HttpAgent extends Agent {
this.#checkAddress = options.checkAddress;
}

dispatch(options: Agent.DispatchOptions, handler: Dispatcher.DispatchHandler): boolean {
dispatch(options: Agent.DispatchOptions, handler: Dispatcher.DispatchHandlers): boolean {
if (this.#checkAddress && options.origin) {
const originUrl = typeof options.origin === 'string' ? new URL(options.origin) : options.origin;
let hostname = originUrl.hostname;
Expand Down
Loading

0 comments on commit cbf75b6

Please sign in to comment.