Comparing version 4.7.0 to 4.7.1
@@ -5,4 +5,4 @@ # Diagnostics Channel Support | ||
Undici support the [`diagnostics_channel`](https://nodejs.org/api/diagnostics_channel.html) (currently available only on Node.js v16+). | ||
It is the preferred way to instrument Undici and retrieve internal informations. | ||
Undici supports the [`diagnostics_channel`](https://nodejs.org/api/diagnostics_channel.html) (currently available only on Node.js v16+). | ||
It is the preferred way to instrument Undici and retrieve internal information. | ||
@@ -19,2 +19,3 @@ The channels available are the following. | ||
diagnosticsChannel.channel('undici:request:create').subscribe(({ request }) => { | ||
console.log('origin', request.origin) | ||
console.log('completed', request.completed) | ||
@@ -44,3 +45,3 @@ console.log('method', request.method) | ||
This message is published after the response headers have been received, i.e. the reponse has been completed. | ||
This message is published after the response headers have been received, i.e. the response has been completed. | ||
@@ -61,3 +62,3 @@ ```js | ||
This message is published after the response body and trailers have been received, i.e. the reponse has been completed. | ||
This message is published after the response body and trailers have been received, i.e. the response has been completed. | ||
@@ -89,5 +90,5 @@ ```js | ||
This message is published right before first byte of the request is written to the socket. | ||
This message is published right before the first byte of the request is written to the socket. | ||
*Note*: It will publish the exact headers that will be sent to the server in raw foramt. | ||
*Note*: It will publish the exact headers that will be sent to the server in raw format. | ||
@@ -105,3 +106,3 @@ ```js | ||
This message is published before creating a new connection for **any** request. | ||
This message is published before creating a new connection for **any** request. | ||
You can not assume that this event is related to any specific request. | ||
@@ -120,3 +121,3 @@ | ||
This message is published after connection established. | ||
This message is published after a connection is established. | ||
@@ -123,0 +124,0 @@ ```js |
@@ -21,3 +21,7 @@ // Ported from https://github.com/nodejs/undici/pull/907 | ||
constructor (resume, abort, contentType = '') { | ||
super({ autoDestroy: true, read: resume }) | ||
super({ | ||
autoDestroy: true, | ||
read: resume, | ||
highWaterMark: 64 * 1024 // Same as nodejs fs streams. | ||
}) | ||
@@ -24,0 +28,0 @@ this._readableState.dataEmitted = false |
@@ -285,4 +285,6 @@ 'use strict' | ||
const request = new Request(opts, handler) | ||
const origin = opts.origin || this[kUrl].origin | ||
const request = new Request(origin, opts, handler) | ||
this[kQueue].push(request) | ||
@@ -289,0 +291,0 @@ if (this[kResuming]) { |
@@ -30,3 +30,3 @@ 'use strict' | ||
class Request { | ||
constructor ({ | ||
constructor (origin, { | ||
path, | ||
@@ -97,2 +97,4 @@ method, | ||
this.origin = origin | ||
this.idempotent = idempotent == null | ||
@@ -99,0 +101,0 @@ ? method === 'HEAD' || method === 'GET' |
{ | ||
"name": "undici", | ||
"version": "4.7.0", | ||
"version": "4.7.1", | ||
"description": "An HTTP/1.1 client, written from scratch for Node.js", | ||
@@ -5,0 +5,0 @@ "homepage": "https://undici.nodejs.org", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
618619
84
9718