You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit is the result of reverting the v5.28.3 security update
and then cleanly cherry-picking all 6.x updates from `main` until
6.6.2, which also includes the security fix.
@@ -119,7 +106,7 @@ Returns a promise with the result of the `Dispatcher.request` method.
119
106
120
107
Calls `options.dispatcher.request(options)`.
121
108
122
-
See [Dispatcher.request](./docs/api/Dispatcher.md#dispatcherrequestoptions-callback) for more details.
109
+
See [Dispatcher.request](./docs/api/Dispatcher.md#dispatcherrequestoptions-callback) for more details, and [request examples](./examples/README.md) for examples.
Copy file name to clipboardExpand all lines: deps/undici/src/docs/api/Dispatcher.md
+1
Original file line number
Diff line number
Diff line change
@@ -209,6 +209,7 @@ Returns: `Boolean` - `false` if dispatcher is busy and further dispatch calls wo
209
209
***onConnect**`(abort: () => void, context: object) => void` - Invoked before request is dispatched on socket. May be invoked multiple times when a request is retried when the request at the head of the pipeline fails.
210
210
***onError**`(error: Error) => void` - Invoked when an error has occurred. May not throw.
211
211
***onUpgrade**`(statusCode: number, headers: Buffer[], socket: Duplex) => void` (optional) - Invoked when request is upgraded. Required if `DispatchOptions.upgrade` is defined or `DispatchOptions.method === 'CONNECT'`.
212
+
***onResponseStarted**`() => void` (optional) - Invoked when response is received, before headers have been read.
212
213
***onHeaders**`(statusCode: number, headers: Buffer[], resume: () => void, statusText: string) => boolean` - Invoked when statusCode and headers have been received. May be invoked multiple times due to 1xx informational headers. Not required for `upgrade` requests.
213
214
***onData**`(chunk: Buffer) => boolean` - Invoked when response payload data is received. Not required for `upgrade` requests.
214
215
***onComplete**`(trailers: Buffer[]) => void` - Invoked when response payload and trailers have been received and the request has completed. Not required for `upgrade` requests.
-**dispatch**`function` - The dispatch function to be called after every retry.
10
+
-**maxRedirections**`number` - Maximum number of redirections allowed.
11
+
-**opts**`object` - Options for handling redirection.
12
+
-**handler**`object` - An object containing handlers for different stages of the request lifecycle.
13
+
-**redirectionLimitReached**`boolean` (default: `false`) - A flag that the implementer can provide to enable or disable the feature. If set to `false`, it indicates that the caller doesn't want to use the feature and prefers the old behavior.
14
+
15
+
Returns: `RedirectHandler`
16
+
17
+
### Parameters
18
+
19
+
-**dispatch**`(options: Dispatch.DispatchOptions, handlers: Dispatch.DispatchHandlers) => Promise<Dispatch.DispatchResponse>` (required) - Dispatch function to be called after every redirection.
20
+
-**maxRedirections**`number` (required) - Maximum number of redirections allowed.
21
+
-**opts**`object` (required) - Options for handling redirection.
22
+
-**handler**`object` (required) - Handlers for different stages of the request lifecycle.
23
+
-**redirectionLimitReached**`boolean` (default: `false`) - A flag that the implementer can provide to enable or disable the feature. If set to `false`, it indicates that the caller doesn't want to use the feature and prefers the old behavior.
24
+
25
+
### Properties
26
+
27
+
-**location**`string` - The current redirection location.
28
+
-**abort**`function` - The abort function.
29
+
-**opts**`object` - The options for handling redirection.
30
+
-**maxRedirections**`number` - Maximum number of redirections allowed.
31
+
-**handler**`object` - Handlers for different stages of the request lifecycle.
32
+
-**history**`Array` - An array representing the history of URLs during redirection.
33
+
-**redirectionLimitReached**`boolean` - Indicates whether the redirection limit has been reached.
34
+
35
+
### Methods
36
+
37
+
#### `onConnect(abort)`
38
+
39
+
Called when the connection is established.
40
+
41
+
Parameters:
42
+
43
+
-**abort**`function` - The abort function.
44
+
45
+
#### `onUpgrade(statusCode, headers, socket)`
46
+
47
+
Called when an upgrade is requested.
48
+
49
+
Parameters:
50
+
51
+
-**statusCode**`number` - The HTTP status code.
52
+
-**headers**`object` - The headers received in the response.
-**obj**`Record<string, string | string[]>` (optional) - Object to specify a proxy object. The parsed value is assigned to this object. But, if **headers** is an object, it is not used.
14
+
15
+
Returns: `Record<string, string | string[]>` If **headers** is an object, it is **headers**. Otherwise, if **obj** is specified, it is equivalent to **obj**.
16
+
17
+
## `headerNameToString(value)`
18
+
19
+
Retrieves a header name and returns its lowercase value.
0 commit comments