From f0a857f4b873007164bf070e18cd3b55f8e52c3c Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Thu, 20 Jun 2019 13:50:22 -0600 Subject: [PATCH] doc: remove "note that" from http2.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refs: https://github.com/nodejs/remark-preset-lint-node/pull/16 PR-URL: https://github.com/nodejs/node/pull/28329 Reviewed-By: Gus Caplan Reviewed-By: Trivikram Kamat Reviewed-By: Tobias Nießen Reviewed-By: Ruben Bridgewater --- doc/api/http2.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/doc/api/http2.md b/doc/api/http2.md index cda24cd338f235..b1cf3479f300a3 100644 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -988,7 +988,7 @@ The `'trailers'` event is emitted when a block of headers associated with trailing header fields is received. The listener callback is passed the [HTTP/2 Headers Object][] and flags associated with the headers. -Note that this event might not be emitted if `http2stream.end()` is called +This event might not be emitted if `http2stream.end()` is called before trailers are received and the incoming data is not being read or listened for. @@ -1488,7 +1488,7 @@ requests. The file descriptor is not closed when the stream is closed, so it will need to be closed manually once it is no longer needed. -Note that using the same file descriptor concurrently for multiple streams +Using the same file descriptor concurrently for multiple streams is not supported and may result in data loss. Re-using a file descriptor after a stream has finished is supported. @@ -1669,7 +1669,7 @@ client should continue to send the request body, or generating an appropriate HTTP response (e.g. 400 Bad Request) if the client should not continue to send the request body. -Note that when this event is emitted and handled, the [`'request'`][] event will +When this event is emitted and handled, the [`'request'`][] event will not be emitted. #### Event: 'request' @@ -1680,7 +1680,7 @@ added: v8.4.0 * `request` {http2.Http2ServerRequest} * `response` {http2.Http2ServerResponse} -Emitted each time there is a request. Note that there may be multiple requests +Emitted each time there is a request. There may be multiple requests per session. See the [Compatibility API][]. #### Event: 'session' @@ -1750,7 +1750,7 @@ added: v8.4.0 Stops the server from accepting new connections. See [`net.Server.close()`][]. -Note that this is not analogous to restricting new requests since HTTP/2 +This is not analogous to restricting new requests since HTTP/2 connections are persistent. To achieve a similar graceful shutdown behavior, consider also using [`http2session.close()`] on active sessions. @@ -1805,7 +1805,7 @@ client should continue to send the request body, or generating an appropriate HTTP response (e.g. 400 Bad Request) if the client should not continue to send the request body. -Note that when this event is emitted and handled, the [`'request'`][] event will +When this event is emitted and handled, the [`'request'`][] event will not be emitted. #### Event: 'request' @@ -1816,7 +1816,7 @@ added: v8.4.0 * `request` {http2.Http2ServerRequest} * `response` {http2.Http2ServerResponse} -Emitted each time there is a request. Note that there may be multiple requests +Emitted each time there is a request. There may be multiple requests per session. See the [Compatibility API][]. #### Event: 'session' @@ -1895,7 +1895,7 @@ added: v8.4.0 Stops the server from accepting new connections. See [`tls.Server.close()`][]. -Note that this is not analogous to restricting new requests since HTTP/2 +This is not analogous to restricting new requests since HTTP/2 connections are persistent. To achieve a similar graceful shutdown behavior, consider also using [`http2session.close()`] on active sessions. @@ -2771,7 +2771,7 @@ added: v8.4.0 The raw request/response headers list exactly as they were received. -Note that the keys and values are in the same list. It is *not* a +The keys and values are in the same list. It is *not* a list of tuples. So, the even-numbered offsets are key values, and the odd-numbered offsets are the associated values. @@ -3035,7 +3035,7 @@ added: v8.4.0 * Returns: {string} Reads out a header that has already been queued but not sent to the client. -Note that the name is case insensitive. +The name is case-insensitive. ```js const contentType = response.getHeader('content-type'); @@ -3094,7 +3094,7 @@ added: v8.4.0 * Returns: {boolean} Returns `true` if the header identified by `name` is currently set in the -outgoing headers. Note that the header name matching is case-insensitive. +outgoing headers. The header name matching is case-insensitive. ```js const hasContentType = response.hasHeader('content-type'); @@ -3278,7 +3278,7 @@ it will switch to implicit header mode and flush the implicit headers. This sends a chunk of the response body. This method may be called multiple times to provide successive parts of the body. -Note that in the `http` module, the response body is omitted when the +In the `http` module, the response body is omitted when the request is a HEAD request. Similarly, the `204` and `304` responses _must not_ include a message body. @@ -3341,12 +3341,12 @@ response.writeHead(200, { 'Content-Type': 'text/plain' }); ``` -Note that Content-Length is given in bytes not characters. The +`Content-Length` is given in bytes not characters. The `Buffer.byteLength()` API may be used to determine the number of bytes in a given encoding. On outbound messages, Node.js does not check if Content-Length and the length of the body being transmitted are equal or not. However, when receiving messages, Node.js will automatically reject messages when the -Content-Length does not match the actual payload size. +`Content-Length` does not match the actual payload size. This method may be called at most one time on a message before [`response.end()`][] is called.