@@ -166,7 +166,7 @@ When invoked, the handler function will receive three arguments:
166166
167167If the ` 'frameError' ` event is associated with a stream, the stream will be
168168closed and destroyed immediately following the ` 'frameError' ` event. If the
169- event is not associated with a stream, the ` Http2Session ` will be shutdown
169+ event is not associated with a stream, the ` Http2Session ` will be shut down
170170immediately following the ` 'frameError' ` event.
171171
172172#### Event: 'goaway'
@@ -183,7 +183,7 @@ the handler function will receive three arguments:
183183* ` opaqueData ` {Buffer} If additional opaque data was included in the GOAWAY
184184 frame, a ` Buffer ` instance will be passed containing that data.
185185
186- * Note* : The ` Http2Session ` instance will be shutdown automatically when the
186+ * Note* : The ` Http2Session ` instance will be shut down automatically when the
187187` 'goaway' ` event is emitted.
188188
189189#### Event: 'localSettings'
@@ -499,7 +499,7 @@ added: v8.4.0
499499 has been completed.
500500* Returns: {undefined}
501501
502- Attempts to shutdown this ` Http2Session ` using HTTP/2 defined procedures.
502+ Attempts to shut down this ` Http2Session ` using HTTP/2 defined procedures.
503503If specified, the given ` callback ` function will be invoked once the shutdown
504504process has completed.
505505
@@ -635,7 +635,7 @@ may be passed to clear any previously set alternative service for a given
635635domain.
636636
637637When a string is passed for the ` originOrStream ` argument, it will be parsed as
638- a URL and the origin will be derived. For insetance , the origin for the
638+ a URL and the origin will be derived. For instance , the origin for the
639639HTTP URL ` 'https://example.org/foo/bar' ` is the ASCII string
640640` 'https://example.org' ` . An error will be thrown if either the given string
641641cannot be parsed as a URL or if a valid origin cannot be derived.
@@ -739,15 +739,15 @@ req.on('response', (headers) => {
739739
740740When set, the ` options.getTrailers() ` function is called immediately after
741741queuing the last chunk of payload data to be sent. The callback is passed a
742- single object (with a ` null ` prototype) that the listener may used to specify
742+ single object (with a ` null ` prototype) that the listener may use to specify
743743the trailing header fields to send to the peer.
744744
745745* Note* : The HTTP/1 specification forbids trailers from containing HTTP/2
746- " pseudo-header" fields (e.g. ` ':method' ` , ` ':path' ` , etc). An ` 'error' ` event
746+ pseudo-header fields (e.g. ` ':method' ` , ` ':path' ` , etc). An ` 'error' ` event
747747will be emitted if the ` getTrailers ` callback attempts to set such header
748748fields.
749749
750- The ` :method ` and ` :path ` pseudoheaders are not specified within ` headers ` ,
750+ The ` :method ` and ` :path ` pseudo-headers are not specified within ` headers ` ,
751751they respectively default to:
752752
753753* ` :method ` = ` 'GET' `
@@ -774,7 +774,7 @@ On the client, `Http2Stream` instances are created and returned when either the
774774` 'push' ` event.
775775
776776* Note* : The ` Http2Stream ` class is a base for the [ ` ServerHttp2Stream ` ] [ ] and
777- [ ` ClientHttp2Stream ` ] [ ] classes, each of which are used specifically by either
777+ [ ` ClientHttp2Stream ` ] [ ] classes, each of which is used specifically by either
778778the Server or Client side, respectively.
779779
780780All ` Http2Stream ` instances are [ ` Duplex ` ] [ ] streams. The ` Writable ` side of the
@@ -798,7 +798,7 @@ On the client side, instances of [`ClientHttp2Stream`][] are created when the
798798` http2session.request() ` may not be immediately ready for use if the parent
799799` Http2Session ` has not yet been fully established. In such cases, operations
800800called on the ` Http2Stream ` will be buffered until the ` 'ready' ` event is
801- emitted. User code should rarely, if ever, have need to handle the ` 'ready' `
801+ emitted. User code should rarely, if ever, need to handle the ` 'ready' `
802802event directly. The ready status of an ` Http2Stream ` can be determined by
803803checking the value of ` http2stream.id ` . If the value is ` undefined ` , the stream
804804is not yet ready for use.
@@ -1048,7 +1048,7 @@ added: v8.4.0
10481048-->
10491049
10501050The ` 'headers' ` event is emitted when an additional block of headers is received
1051- for a stream, such as when a block of ` 1xx ` informational headers are received.
1051+ for a stream, such as when a block of ` 1xx ` informational headers is received.
10521052The listener callback is passed the [ Headers Object] [ ] and flags associated with
10531053the headers.
10541054
@@ -1198,7 +1198,7 @@ server.on('stream', (stream) => {
11981198
11991199When set, the ` options.getTrailers() ` function is called immediately after
12001200queuing the last chunk of payload data to be sent. The callback is passed a
1201- single object (with a ` null ` prototype) that the listener may used to specify
1201+ single object (with a ` null ` prototype) that the listener may use to specify
12021202the trailing header fields to send to the peer.
12031203
12041204``` js
@@ -1215,7 +1215,7 @@ server.on('stream', (stream) => {
12151215```
12161216
12171217* Note* : The HTTP/1 specification forbids trailers from containing HTTP/2
1218- " pseudo-header" fields (e.g. ` ':status' ` , ` ':path' ` , etc). An ` 'error' ` event
1218+ pseudo-header fields (e.g. ` ':status' ` , ` ':path' ` , etc). An ` 'error' ` event
12191219will be emitted if the ` getTrailers ` callback attempts to set such header
12201220fields.
12211221
@@ -1272,7 +1272,7 @@ requests.
12721272
12731273When set, the ` options.getTrailers() ` function is called immediately after
12741274queuing the last chunk of payload data to be sent. The callback is passed a
1275- single object (with a ` null ` prototype) that the listener may used to specify
1275+ single object (with a ` null ` prototype) that the listener may use to specify
12761276the trailing header fields to send to the peer.
12771277
12781278``` js
@@ -1299,7 +1299,7 @@ server.on('close', () => fs.closeSync(fd));
12991299```
13001300
13011301* Note* : The HTTP/1 specification forbids trailers from containing HTTP/2
1302- " pseudo-header" fields (e.g. ` ':status' ` , ` ':path' ` , etc). An ` 'error' ` event
1302+ pseudo-header fields (e.g. ` ':status' ` , ` ':path' ` , etc). An ` 'error' ` event
13031303will be emitted if the ` getTrailers ` callback attempts to set such header
13041304fields.
13051305
@@ -1331,7 +1331,7 @@ of the given file:
13311331
13321332If an error occurs while attempting to read the file data, the ` Http2Stream `
13331333will be closed using an ` RST_STREAM ` frame using the standard ` INTERNAL_ERROR `
1334- code. If the ` onError ` callback is defined it will be called, otherwise
1334+ code. If the ` onError ` callback is defined, then it will be called. Otherwise
13351335the stream will be destroyed.
13361336
13371337Example using a file path:
@@ -1391,7 +1391,7 @@ default behavior is to destroy the stream.
13911391
13921392When set, the ` options.getTrailers() ` function is called immediately after
13931393queuing the last chunk of payload data to be sent. The callback is passed a
1394- single object (with a ` null ` prototype) that the listener may used to specify
1394+ single object (with a ` null ` prototype) that the listener may use to specify
13951395the trailing header fields to send to the peer.
13961396
13971397``` js
@@ -1408,7 +1408,7 @@ server.on('stream', (stream) => {
14081408```
14091409
14101410* Note* : The HTTP/1 specification forbids trailers from containing HTTP/2
1411- " pseudo-header" fields (e.g. ` ':status' ` , ` ':path' ` , etc). An ` 'error' ` event
1411+ pseudo-header fields (e.g. ` ':status' ` , ` ':path' ` , etc). An ` 'error' ` event
14121412will be emitted if the ` getTrailers ` callback attempts to set such header
14131413fields.
14141414
@@ -1478,7 +1478,7 @@ an `Http2Session` object associated with the `Http2Server`.
14781478added: v8.5.0
14791479-->
14801480
1481- If an ` ServerHttp2Stream ` emits an ` 'error' ` event, it will be forwarded here.
1481+ If a ` ServerHttp2Stream ` emits an ` 'error' ` event, it will be forwarded here.
14821482The stream will already be destroyed when this event is triggered.
14831483
14841484#### Event: 'stream'
@@ -1633,6 +1633,15 @@ changes:
16331633* ` options ` {Object}
16341634 * ` maxDeflateDynamicTableSize ` {number} Sets the maximum dynamic table size
16351635 for deflating header fields. ** Default:** ` 4Kib `
1636+ * ` maxSessionMemory ` {number} Sets the maximum memory that the ` Http2Session `
1637+ is permitted to use. The value is expressed in terms of number of megabytes,
1638+ e.g. ` 1 ` equal 1 megabyte. The minimum value allowed is ` 1 ` . ** Default:**
1639+ ` 10 ` . This is a credit based limit, existing ` Http2Stream ` s may cause this
1640+ limit to be exceeded, but new ` Http2Stream ` instances will be rejected
1641+ while this limit is exceeded. The current number of ` Http2Stream ` sessions,
1642+ the current memory use of the header compression tables, current data
1643+ queued to be sent, and unacknowledged PING and SETTINGS frames are all
1644+ counted towards the current limit.
16361645 * ` maxHeaderListPairs ` {number} Sets the maximum number of header entries.
16371646 ** Default:** ` 128 ` . The minimum value is ` 4 ` .
16381647 * ` maxOutstandingPings ` {number} Sets the maximum number of outstanding,
@@ -1655,7 +1664,7 @@ changes:
16551664 * ` http2.constants.PADDING_STRATEGY_ALIGNED ` - Will * attempt* to apply
16561665 enough padding to ensure that the total frame length, including the
16571666 9-byte header, is a multiple of 8. For each frame, however, there is a
1658- maxmimum allowed number of padding bytes that is determined by current
1667+ maximum allowed number of padding bytes that is determined by current
16591668 flow control state and settings. If this maximum is less than the
16601669 calculated amount needed to ensure alignment, the maximum will be used
16611670 and the total frame length will * not* necessarily be aligned at 8 bytes.
@@ -1711,6 +1720,15 @@ changes:
17111720 ` false ` . See the [ ` 'unknownProtocol' ` ] [ ] event. See [ ALPN negotiation] [ ] .
17121721 * ` maxDeflateDynamicTableSize ` {number} Sets the maximum dynamic table size
17131722 for deflating header fields. ** Default:** ` 4Kib `
1723+ * ` maxSessionMemory ` {number} Sets the maximum memory that the ` Http2Session `
1724+ is permitted to use. The value is expressed in terms of number of megabytes,
1725+ e.g. ` 1 ` equal 1 megabyte. The minimum value allowed is ` 1 ` . ** Default:**
1726+ ` 10 ` . This is a credit based limit, existing ` Http2Stream ` s may cause this
1727+ limit to be exceeded, but new ` Http2Stream ` instances will be rejected
1728+ while this limit is exceeded. The current number of ` Http2Stream ` sessions,
1729+ the current memory use of the header compression tables, current data
1730+ queued to be sent, and unacknowledged PING and SETTINGS frames are all
1731+ counted towards the current limit.
17141732 * ` maxHeaderListPairs ` {number} Sets the maximum number of header entries.
17151733 ** Default:** ` 128 ` . The minimum value is ` 4 ` .
17161734 * ` maxOutstandingPings ` {number} Sets the maximum number of outstanding,
@@ -1733,7 +1751,7 @@ changes:
17331751 * ` http2.constants.PADDING_STRATEGY_ALIGNED ` - Will * attempt* to apply
17341752 enough padding to ensure that the total frame length, including the
17351753 9-byte header, is a multiple of 8. For each frame, however, there is a
1736- maxmimum allowed number of padding bytes that is determined by current
1754+ maximum allowed number of padding bytes that is determined by current
17371755 flow control state and settings. If this maximum is less than the
17381756 calculated amount needed to ensure alignment, the maximum will be used
17391757 and the total frame length will * not* necessarily be aligned at 8 bytes.
@@ -1794,6 +1812,15 @@ changes:
17941812* ` options ` {Object}
17951813 * ` maxDeflateDynamicTableSize ` {number} Sets the maximum dynamic table size
17961814 for deflating header fields. ** Default:** ` 4Kib `
1815+ * ` maxSessionMemory ` {number} Sets the maximum memory that the ` Http2Session `
1816+ is permitted to use. The value is expressed in terms of number of megabytes,
1817+ e.g. ` 1 ` equal 1 megabyte. The minimum value allowed is ` 1 ` . ** Default:**
1818+ ` 10 ` . This is a credit based limit, existing ` Http2Stream ` s may cause this
1819+ limit to be exceeded, but new ` Http2Stream ` instances will be rejected
1820+ while this limit is exceeded. The current number of ` Http2Stream ` sessions,
1821+ the current memory use of the header compression tables, current data
1822+ queued to be sent, and unacknowledged PING and SETTINGS frames are all
1823+ counted towards the current limit.
17971824 * ` maxHeaderListPairs ` {number} Sets the maximum number of header entries.
17981825 ** Default:** ` 128 ` . The minimum value is ` 1 ` .
17991826 * ` maxOutstandingPings ` {number} Sets the maximum number of outstanding,
@@ -1820,7 +1847,7 @@ changes:
18201847 * ` http2.constants.PADDING_STRATEGY_ALIGNED ` - Will * attempt* to apply
18211848 enough padding to ensure that the total frame length, including the
18221849 9-byte header, is a multiple of 8. For each frame, however, there is a
1823- maxmimum allowed number of padding bytes that is determined by current
1850+ maximum allowed number of padding bytes that is determined by current
18241851 flow control state and settings. If this maximum is less than the
18251852 calculated amount needed to ensure alignment, the maximum will be used
18261853 and the total frame length will * not* necessarily be aligned at 8 bytes.
@@ -2162,8 +2189,8 @@ req.end('Jane');
21622189
21632190The Compatibility API has the goal of providing a similar developer experience
21642191of HTTP/1 when using HTTP/2, making it possible to develop applications
2165- that supports both [ HTTP/1] [ ] and HTTP/2. This API targets only the
2166- ** public API** of the [ HTTP/1] [ ] , however many modules uses internal
2192+ that support both [ HTTP/1] [ ] and HTTP/2. This API targets only the
2193+ ** public API** of the [ HTTP/1] [ ] . However many modules use internal
21672194methods or state, and those _ are not supported_ as it is a completely
21682195different implementation.
21692196
@@ -2191,7 +2218,7 @@ the status message for HTTP codes is ignored.
21912218
21922219### ALPN negotiation
21932220
2194- ALPN negotiation allows to support both [ HTTPS] [ ] and HTTP/2 over
2221+ ALPN negotiation allows supporting both [ HTTPS] [ ] and HTTP/2 over
21952222the same socket. The ` req ` and ` res ` objects can be either HTTP/1 or
21962223HTTP/2, and an application ** must** restrict itself to the public API of
21972224[ HTTP/1] [ ] , and detect if it is possible to use the more advanced
@@ -2233,7 +2260,7 @@ added: v8.4.0
22332260
22342261A ` Http2ServerRequest ` object is created by [ ` http2.Server ` ] [ ] or
22352262[ ` http2.SecureServer ` ] [ ] and passed as the first argument to the
2236- [ ` 'request' ` ] [ ] event. It may be used to access a request status, headers and
2263+ [ ` 'request' ` ] [ ] event. It may be used to access a request status, headers, and
22372264data.
22382265
22392266It implements the [ Readable Stream] [ ] interface, as well as the
@@ -2294,7 +2321,7 @@ console.log(request.headers);
22942321
22952322See [ Headers Object] [ ] .
22962323
2297- * Note* : In HTTP/2, the request path, host name , protocol, and method are
2324+ * Note* : In HTTP/2, the request path, hostname , protocol, and method are
22982325represented as special headers prefixed with the ` : ` character (e.g. ` ':path' ` ).
22992326These special headers will be included in the ` request.headers ` object. Care
23002327must be taken not to inadvertently modify these special headers or errors may
@@ -2327,7 +2354,7 @@ added: v8.4.0
23272354
23282355* {string}
23292356
2330- The request method as a string. Read only. Example:
2357+ The request method as a string. Read- only. Example:
23312358` 'GET' ` , ` 'DELETE' ` .
23322359
23332360#### request.rawHeaders
@@ -2985,7 +3012,7 @@ If `name` is equal to `Http2Session`, the `PerformanceEntry` will contain the
29853012following additional properties:
29863013
29873014* ` pingRTT ` {number} The number of milliseconds elapsed since the transmission
2988- of a ` PING ` frame and the reception of its acknowledgement . Only present if
3015+ of a ` PING ` frame and the reception of its acknowledgment . Only present if
29893016 a ` PING ` frame has been sent on the ` Http2Session ` .
29903017* ` streamCount ` {number} The number of ` Http2Stream ` instances processed by
29913018 the ` Http2Session ` .
0 commit comments