-
Notifications
You must be signed in to change notification settings - Fork 559
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: export UndiciHeaders type and set dispatch headers to UndiciHeaders #3849
base: main
Are you sure you want to change the base?
fix: export UndiciHeaders type and set dispatch headers to UndiciHeaders #3849
Conversation
@@ -194,7 +194,7 @@ Returns: `Boolean` - `false` if dispatcher is busy and further dispatch calls wo | |||
* **method** `string` | |||
* **reset** `boolean` (optional) - Default: `false` - If `false`, the request will attempt to create a long-living connection by sending the `connection: keep-alive` header,otherwise will attempt to close it immediately after response by sending `connection: close` within the request and closing the socket afterwards. | |||
* **body** `string | Buffer | Uint8Array | stream.Readable | Iterable | AsyncIterable | null` (optional) - Default: `null` | |||
* **headers** `UndiciHeaders | string[]` (optional) - Default: `null`. | |||
* **headers** `UndiciHeaders` (optional) - Default: `null`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure we should have undici types here? @mcollina
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can rename to OutgoingHttpHeaders
also.
I saw this in the docs which matched the type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any thoughts on this @mcollina ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should define UndiciHeaders
somewhere if we do.
@@ -194,7 +194,7 @@ Returns: `Boolean` - `false` if dispatcher is busy and further dispatch calls wo | |||
* **method** `string` | |||
* **reset** `boolean` (optional) - Default: `false` - If `false`, the request will attempt to create a long-living connection by sending the `connection: keep-alive` header,otherwise will attempt to close it immediately after response by sending `connection: close` within the request and closing the socket afterwards. | |||
* **body** `string | Buffer | Uint8Array | stream.Readable | Iterable | AsyncIterable | null` (optional) - Default: `null` | |||
* **headers** `UndiciHeaders | string[]` (optional) - Default: `null`. | |||
* **headers** `UndiciHeaders` (optional) - Default: `null`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should define UndiciHeaders
somewhere if we do.
types/dispatcher.d.ts
Outdated
@@ -12,6 +12,8 @@ type AbortSignal = unknown | |||
|
|||
export default Dispatcher | |||
|
|||
export type UndiciHeaders = IncomingHttpHeaders | string[] | Iterable<[string, string | string[] | undefined]> | null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This definition should be in the docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
87c3c6d
to
d41d11d
Compare
This relates to...
#3840
Changes
UndiciHeaders
UndiciHeaders
test/types/dispatcher.test.d.ts
Status