diff --git a/test/types/dispatcher.test-d.ts b/test/types/dispatcher.test-d.ts index 303abd0ade7..1c84ed01443 100644 --- a/test/types/dispatcher.test-d.ts +++ b/test/types/dispatcher.test-d.ts @@ -35,6 +35,7 @@ expectAssignable(new Dispatcher()) expectAssignable(dispatcher.dispatch({ origin: '', path: '', method: 'GET', headers: mapHeaders, reset: true }, {})) expectAssignable(dispatcher.dispatch({ origin: '', path: '', method: 'GET', headers: iteratorHeaders, reset: true }, {})) expectAssignable(dispatcher.dispatch({ origin: new URL('http://localhost'), path: '', method: 'GET' }, {})) + expectAssignable(dispatcher.dispatch({ path: '', method: "CUSTOM" }, {})) // connect expectAssignable>(dispatcher.connect({ origin: '', path: '', maxRedirections: 0 })) diff --git a/types/dispatcher.d.ts b/types/dispatcher.d.ts index 6f33adc4a1d..eafa2e5907e 100644 --- a/types/dispatcher.d.ts +++ b/types/dispatcher.d.ts @@ -234,7 +234,7 @@ declare namespace Dispatcher { onBodySent?(chunkSize: number, totalBytesSent: number): void; } export type PipelineHandler = (data: PipelineHandlerData) => Readable; - export type HttpMethod = 'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'CONNECT' | 'OPTIONS' | 'TRACE' | 'PATCH'; + export type HttpMethod = 'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'CONNECT' | 'OPTIONS' | 'TRACE' | 'PATCH' | (string & Record); /** * @link https://fetch.spec.whatwg.org/#body-mixin