From d3db87a5bdeab5a262fb6aed0fc8901f2a754426 Mon Sep 17 00:00:00 2001 From: killagu Date: Wed, 4 Dec 2024 19:00:25 +0800 Subject: [PATCH] feat: export undici --- src/fetch.ts | 6 +++--- src/index.ts | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/fetch.ts b/src/fetch.ts index ba1779ea..d6320cc9 100644 --- a/src/fetch.ts +++ b/src/fetch.ts @@ -224,11 +224,11 @@ export class FetchFactory { res = await UndiciFetch(input, init); }); } catch (e: any) { - channels.response.publish({ + channels.fetchResponse.publish({ fetch: fetchMeta, - error: e, + error: e,n } as FetchResponseDiagnosticsMessage); - channels.fetchResponse.publish({ + channels.response.publish({ request: reqMeta, response: urllibResponse, error: e, diff --git a/src/index.ts b/src/index.ts index 06a495da..2c450400 100644 --- a/src/index.ts +++ b/src/index.ts @@ -40,7 +40,8 @@ export { MockAgent, ProxyAgent, Agent, Dispatcher, setGlobalDispatcher, getGlobalDispatcher, Request, RequestInfo, RequestInit, - Response, + Response, BodyInit, ResponseInit, + Headers, FormData, File, } from 'undici'; // HttpClient2 is keep compatible with urllib@2 HttpClient2 export {