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
Copy file name to clipboardExpand all lines: deps/undici/src/MAINTAINERS.md
+10Lines changed: 10 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -31,3 +31,13 @@ Maintainers are encouraged to use the extensive and detailed list of labels for
31
31
* Issues with a low-barrier of entry should be assigned the `good first issue` label.
32
32
* Do not use the `invalid` label, instead use `bug` or `Status: wontfix`.
33
33
* Duplicate issues should initially be assigned the `duplicate` label.
34
+
35
+
36
+
## Making a Release
37
+
38
+
1. Go to github actions, then select ["Create Release PR"](https://github.com/nodejs/undici/actions/workflows/release-create-pr.yml).
39
+
2. Run the workflow, selecting `main` and indicating if you want a specific version number or a patch/minor/major release
40
+
3. Wait for the PR to be created. Approve the PR ([this](https://github.com/nodejs/undici/pull/4021) is a an example).
41
+
4. Land the PR, wait for the CI to pass.
42
+
5. Got to the ["Release"](https://github.com/nodejs/undici/actions/workflows/release.yml) workflow, you should see a job waiting.
43
+
6. If you are one of the [releases](https://github.com/nodejs/undici?tab=readme-ov-file#releasers), then click "review deployments", then select "release" and click "approve and deploy". If you are not a releaser, contact one.
***method**`String` - Default: `PUT` if `options.body`, otherwise `GET`
130
-
***maxRedirections**`Integer` - Default: `0`
131
115
132
116
Returns a promise with the result of the `Dispatcher.request` method.
133
117
134
118
Calls `options.dispatcher.request(options)`.
135
119
136
-
See [Dispatcher.request](./docs/docs/api/Dispatcher.md#dispatcherrequestoptions-callback) for more details, and [request examples](./examples/README.md) for examples.
120
+
See [Dispatcher.request](./docs/docs/api/Dispatcher.md#dispatcherrequestoptions-callback) for more details, and [request examples](./docs/examples/README.md) for examples.
Returns a promise with the result of the `Dispatcher.connect` method.
@@ -234,7 +215,7 @@ A body can be of the following types:
234
215
- URLSearchParams
235
216
- FormData
236
217
237
-
In this implementation of fetch, ```request.body``` now accepts ```Async Iterables```. It is not present in the [Fetch Standard.](https://fetch.spec.whatwg.org)
218
+
In this implementation of fetch, ```request.body``` now accepts ```Async Iterables```. It is not present in the [Fetch Standard](https://fetch.spec.whatwg.org).
In this implementation of fetch, `request.duplex` must be set if `request.body` is `ReadableStream` or `Async Iterables`, however, fetch requests are currently always full duplex. For more detail refer to the [Fetch Standard.](https://fetch.spec.whatwg.org/#dom-requestinit-duplex).
249
+
In this implementation of fetch, `request.duplex` must be set if `request.body` is `ReadableStream` or `Async Iterables`, however, even though the value must be set to `'half'`, it is actually a _full_duplex. For more detail refer to the [Fetch Standard](https://fetch.spec.whatwg.org/#dom-requestinit-duplex).
269
250
270
251
#### `response.body`
271
252
272
-
Nodejs has two kinds of streams: [web streams](https://nodejs.org/dist/latest-v16.x/docs/api/webstreams.html), which follow the API of the WHATWG web standard found in browsers, and an older Node-specific [streams API](https://nodejs.org/api/stream.html). `response.body` returns a readable web stream. If you would prefer to work with a Node stream you can convert a web stream using `.fromWeb()`.
253
+
Nodejs has two kinds of streams: [web streams](https://nodejs.org/api/webstreams.html), which follow the API of the WHATWG web standard found in browsers, and an older Node-specific [streams API](https://nodejs.org/api/stream.html). `response.body` returns a readable web stream. If you would prefer to work with a Node stream you can convert a web stream using `.fromWeb()`.
273
254
274
255
```js
275
256
import { fetch } from'undici'
@@ -300,17 +281,23 @@ stalls or deadlocks when running out of connections.
300
281
301
282
```js
302
283
// Do
303
-
constheaders=awaitfetch(url)
304
-
.then(asyncres=> {
305
-
forawait (constchunkofres.body) {
306
-
// force consumption of body
307
-
}
308
-
returnres.headers
309
-
})
284
+
const { body, headers } =awaitfetch(url);
285
+
forawait (constchunkofbody) {
286
+
// force consumption of body
287
+
}
310
288
311
289
// Do not
312
-
constheaders=awaitfetch(url)
313
-
.then(res=>res.headers)
290
+
const { headers } =awaitfetch(url);
291
+
```
292
+
293
+
The same applies for `request` too:
294
+
```js
295
+
// Do
296
+
const { body, headers } =awaitrequest(url);
297
+
awaitres.body.dump(); // force consumption of body
298
+
299
+
// Do not
300
+
const { headers } =awaitrequest(url);
314
301
```
315
302
316
303
However, if you want to get only headers, it might be better to use `HEAD` request method. Usage of this method will obviate the need for consumption or cancelling of the response body. See [MDN - HTTP - HTTP request methods - HEAD](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/HEAD) for more details.
0 commit comments