Skip to content

Commit 669781a

Browse files
committed
fixup
1 parent 78695b8 commit 669781a

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

docs/docs/api/Dispatcher.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ Returns: `Boolean` - `false` if dispatcher is busy and further dispatch calls wo
197197
* **headers** `UndiciHeaders | string[]` (optional) - Default: `null`.
198198
* **query** `Record<string, any> | null` (optional) - Default: `null` - Query string params to be embedded in the request URL. Note that both keys and values of query are encoded using `encodeURIComponent`. If for some reason you need to send them unencoded, embed query params into path directly instead.
199199
* **idempotent** `boolean` (optional) - Default: `true` if `method` is `'HEAD'` or `'GET'` - Whether the requests can be safely retried or not. If `false` the request won't be sent until all preceding requests in the pipeline has completed.
200-
* **blocking** `boolean` (optional) - Default: `false` - Whether the response is expected to take a long time and would end up blocking the pipeline. When this is set to `true` further pipelining will be avoided on the same connection until headers have been received.
200+
* **blocking** `boolean` (optional) - Default: `method !== 'HEAD'` - Whether the response is expected to take a long time and would end up blocking the pipeline. When this is set to `true` further pipelining will be avoided on the same connection until headers have been received.
201201
* **upgrade** `string | null` (optional) - Default: `null` - Upgrade the request. Should be used to specify the kind of upgrade i.e. `'Websocket'`.
202202
* **bodyTimeout** `number | null` (optional) - The timeout after which a request will time out, in milliseconds. Monitors time between receiving body data. Use `0` to disable it entirely. Defaults to 300 seconds.
203203
* **headersTimeout** `number | null` (optional) - The amount of time, in milliseconds, the parser will wait to receive the complete HTTP headers while not sending the request. Defaults to 300 seconds.
@@ -1021,7 +1021,7 @@ The `dns` interceptor enables you to cache DNS lookups for a given duration, per
10211021
- It can be either `'4` or `6`.
10221022
- It will only take effect if `dualStack` is `false`.
10231023
- `lookup: (hostname: string, options: LookupOptions, callback: (err: NodeJS.ErrnoException | null, addresses: DNSInterceptorRecord[]) => void) => void` - Custom lookup function. Default: `dns.lookup`.
1024-
- For more info see [dns.lookup](https://nodejs.org/api/dns.html#dns_dns_lookup_hostname_options_callback).
1024+
- For more info see [dns.lookup](https://nodejs.org/api/dns.html#dns_dns_lookup_hostname_options_callback).
10251025
- `pick: (origin: URL, records: DNSInterceptorRecords, affinity: 4 | 6) => DNSInterceptorRecord` - Custom pick function. Default: `RoundRobin`.
10261026
- The function should return a single record from the records array.
10271027
- By default a simplified version of Round Robin is used.

test/client-pipelining.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ test('20 times GET with pipelining 10', async (t) => {
6161
})
6262

6363
function makeRequestAndExpectUrl (client, i, t, cb) {
64-
return client.request({ path: '/' + i, method: 'GET' }, (err, { statusCode, headers, body }) => {
64+
return client.request({ path: '/' + i, method: 'GET', blocking: false }, (err, { statusCode, headers, body }) => {
6565
cb()
6666
t.ifError(err)
6767
t.strictEqual(statusCode, 200)
@@ -587,7 +587,8 @@ test('pipelining empty pipeline before reset', async (t) => {
587587

588588
client.request({
589589
path: '/',
590-
method: 'GET'
590+
method: 'GET',
591+
blocking: false
591592
}, (err, data) => {
592593
t.ifError(err)
593594
data.body

types/dispatcher.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ declare namespace Dispatcher {
108108
query?: Record<string, any>;
109109
/** Whether the requests can be safely retried or not. If `false` the request won't be sent until all preceding requests in the pipeline have completed. Default: `true` if `method` is `HEAD` or `GET`. */
110110
idempotent?: boolean;
111-
/** Whether the response is expected to take a long time and would end up blocking the pipeline. When this is set to `true` further pipelining will be avoided on the same connection until headers have been received. */
111+
/** Whether the response is expected to take a long time and would end up blocking the pipeline. When this is set to `true` further pipelining will be avoided on the same connection until headers have been received. Defaults to `method !== 'HEAD'`. */
112112
blocking?: boolean;
113113
/** Upgrade the request. Should be used to specify the kind of upgrade i.e. `'Websocket'`. Default: `method === 'CONNECT' || null`. */
114114
upgrade?: boolean | string | null;

0 commit comments

Comments
 (0)