Skip to content

Commit 591f78b

Browse files
TrottMylesBorins
authored andcommitted
doc: grammar fixes in http2.md
Backport-PR-URL: #18050 Backport-PR-URL: #20456 PR-URL: #17972 Reviewed-By: Weijia Wang <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
1 parent a85518e commit 591f78b

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

doc/api/http2.md

+28-28
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ When invoked, the handler function will receive three arguments:
166166

167167
If the `'frameError'` event is associated with a stream, the stream will be
168168
closed 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
170170
immediately 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.
503503
If specified, the given `callback` function will be invoked once the shutdown
504504
process has completed.
505505

@@ -647,7 +647,7 @@ may be passed to clear any previously set alternative service for a given
647647
domain.
648648

649649
When a string is passed for the `originOrStream` argument, it will be parsed as
650-
a URL and the origin will be derived. For insetance, the origin for the
650+
a URL and the origin will be derived. For instance, the origin for the
651651
HTTP URL `'https://example.org/foo/bar'` is the ASCII string
652652
`'https://example.org'`. An error will be thrown if either the given string
653653
cannot be parsed as a URL or if a valid origin cannot be derived.
@@ -751,15 +751,15 @@ req.on('response', (headers) => {
751751

752752
When set, the `options.getTrailers()` function is called immediately after
753753
queuing the last chunk of payload data to be sent. The callback is passed a
754-
single object (with a `null` prototype) that the listener may used to specify
754+
single object (with a `null` prototype) that the listener may use to specify
755755
the trailing header fields to send to the peer.
756756

757757
*Note*: The HTTP/1 specification forbids trailers from containing HTTP/2
758-
"pseudo-header" fields (e.g. `':method'`, `':path'`, etc). An `'error'` event
758+
pseudo-header fields (e.g. `':method'`, `':path'`, etc). An `'error'` event
759759
will be emitted if the `getTrailers` callback attempts to set such header
760760
fields.
761761

762-
The `:method` and `:path` pseudoheaders are not specified within `headers`,
762+
The `:method` and `:path` pseudo-headers are not specified within `headers`,
763763
they respectively default to:
764764

765765
* `:method` = `'GET'`
@@ -786,7 +786,7 @@ On the client, `Http2Stream` instances are created and returned when either the
786786
`'push'` event.
787787

788788
*Note*: The `Http2Stream` class is a base for the [`ServerHttp2Stream`][] and
789-
[`ClientHttp2Stream`][] classes, each of which are used specifically by either
789+
[`ClientHttp2Stream`][] classes, each of which is used specifically by either
790790
the Server or Client side, respectively.
791791

792792
All `Http2Stream` instances are [`Duplex`][] streams. The `Writable` side of the
@@ -810,7 +810,7 @@ On the client side, instances of [`ClientHttp2Stream`][] are created when the
810810
`http2session.request()` may not be immediately ready for use if the parent
811811
`Http2Session` has not yet been fully established. In such cases, operations
812812
called on the `Http2Stream` will be buffered until the `'ready'` event is
813-
emitted. User code should rarely, if ever, have need to handle the `'ready'`
813+
emitted. User code should rarely, if ever, need to handle the `'ready'`
814814
event directly. The ready status of an `Http2Stream` can be determined by
815815
checking the value of `http2stream.id`. If the value is `undefined`, the stream
816816
is not yet ready for use.
@@ -1067,7 +1067,7 @@ added: v8.4.0
10671067
-->
10681068

10691069
The `'headers'` event is emitted when an additional block of headers is received
1070-
for a stream, such as when a block of `1xx` informational headers are received.
1070+
for a stream, such as when a block of `1xx` informational headers is received.
10711071
The listener callback is passed the [Headers Object][] and flags associated with
10721072
the headers.
10731073

@@ -1217,7 +1217,7 @@ server.on('stream', (stream) => {
12171217

12181218
When set, the `options.getTrailers()` function is called immediately after
12191219
queuing the last chunk of payload data to be sent. The callback is passed a
1220-
single object (with a `null` prototype) that the listener may used to specify
1220+
single object (with a `null` prototype) that the listener may use to specify
12211221
the trailing header fields to send to the peer.
12221222

12231223
```js
@@ -1234,7 +1234,7 @@ server.on('stream', (stream) => {
12341234
```
12351235

12361236
*Note*: The HTTP/1 specification forbids trailers from containing HTTP/2
1237-
"pseudo-header" fields (e.g. `':status'`, `':path'`, etc). An `'error'` event
1237+
pseudo-header fields (e.g. `':status'`, `':path'`, etc). An `'error'` event
12381238
will be emitted if the `getTrailers` callback attempts to set such header
12391239
fields.
12401240

@@ -1291,7 +1291,7 @@ requests.
12911291

12921292
When set, the `options.getTrailers()` function is called immediately after
12931293
queuing the last chunk of payload data to be sent. The callback is passed a
1294-
single object (with a `null` prototype) that the listener may used to specify
1294+
single object (with a `null` prototype) that the listener may use to specify
12951295
the trailing header fields to send to the peer.
12961296

12971297
```js
@@ -1318,7 +1318,7 @@ server.on('close', () => fs.closeSync(fd));
13181318
```
13191319

13201320
*Note*: The HTTP/1 specification forbids trailers from containing HTTP/2
1321-
"pseudo-header" fields (e.g. `':status'`, `':path'`, etc). An `'error'` event
1321+
pseudo-header fields (e.g. `':status'`, `':path'`, etc). An `'error'` event
13221322
will be emitted if the `getTrailers` callback attempts to set such header
13231323
fields.
13241324

@@ -1350,7 +1350,7 @@ of the given file:
13501350

13511351
If an error occurs while attempting to read the file data, the `Http2Stream`
13521352
will be closed using an `RST_STREAM` frame using the standard `INTERNAL_ERROR`
1353-
code. If the `onError` callback is defined it will be called, otherwise
1353+
code. If the `onError` callback is defined, then it will be called. Otherwise
13541354
the stream will be destroyed.
13551355

13561356
Example using a file path:
@@ -1410,7 +1410,7 @@ default behavior is to destroy the stream.
14101410

14111411
When set, the `options.getTrailers()` function is called immediately after
14121412
queuing the last chunk of payload data to be sent. The callback is passed a
1413-
single object (with a `null` prototype) that the listener may used to specify
1413+
single object (with a `null` prototype) that the listener may use to specify
14141414
the trailing header fields to send to the peer.
14151415

14161416
```js
@@ -1427,7 +1427,7 @@ server.on('stream', (stream) => {
14271427
```
14281428

14291429
*Note*: The HTTP/1 specification forbids trailers from containing HTTP/2
1430-
"pseudo-header" fields (e.g. `':status'`, `':path'`, etc). An `'error'` event
1430+
pseudo-header fields (e.g. `':status'`, `':path'`, etc). An `'error'` event
14311431
will be emitted if the `getTrailers` callback attempts to set such header
14321432
fields.
14331433

@@ -1497,7 +1497,7 @@ an `Http2Session` object associated with the `Http2Server`.
14971497
added: v8.5.0
14981498
-->
14991499

1500-
If an `ServerHttp2Stream` emits an `'error'` event, it will be forwarded here.
1500+
If a `ServerHttp2Stream` emits an `'error'` event, it will be forwarded here.
15011501
The stream will already be destroyed when this event is triggered.
15021502

15031503
#### Event: 'stream'
@@ -1683,7 +1683,7 @@ changes:
16831683
* `http2.constants.PADDING_STRATEGY_ALIGNED` - Will *attempt* to apply
16841684
enough padding to ensure that the total frame length, including the
16851685
9-byte header, is a multiple of 8. For each frame, however, there is a
1686-
maxmimum allowed number of padding bytes that is determined by current
1686+
maximum allowed number of padding bytes that is determined by current
16871687
flow control state and settings. If this maximum is less than the
16881688
calculated amount needed to ensure alignment, the maximum will be used
16891689
and the total frame length will *not* necessarily be aligned at 8 bytes.
@@ -1770,7 +1770,7 @@ changes:
17701770
* `http2.constants.PADDING_STRATEGY_ALIGNED` - Will *attempt* to apply
17711771
enough padding to ensure that the total frame length, including the
17721772
9-byte header, is a multiple of 8. For each frame, however, there is a
1773-
maxmimum allowed number of padding bytes that is determined by current
1773+
maximum allowed number of padding bytes that is determined by current
17741774
flow control state and settings. If this maximum is less than the
17751775
calculated amount needed to ensure alignment, the maximum will be used
17761776
and the total frame length will *not* necessarily be aligned at 8 bytes.
@@ -1866,7 +1866,7 @@ changes:
18661866
* `http2.constants.PADDING_STRATEGY_ALIGNED` - Will *attempt* to apply
18671867
enough padding to ensure that the total frame length, including the
18681868
9-byte header, is a multiple of 8. For each frame, however, there is a
1869-
maxmimum allowed number of padding bytes that is determined by current
1869+
maximum allowed number of padding bytes that is determined by current
18701870
flow control state and settings. If this maximum is less than the
18711871
calculated amount needed to ensure alignment, the maximum will be used
18721872
and the total frame length will *not* necessarily be aligned at 8 bytes.
@@ -2208,8 +2208,8 @@ req.end('Jane');
22082208

22092209
The Compatibility API has the goal of providing a similar developer experience
22102210
of HTTP/1 when using HTTP/2, making it possible to develop applications
2211-
that supports both [HTTP/1][] and HTTP/2. This API targets only the
2212-
**public API** of the [HTTP/1][], however many modules uses internal
2211+
that support both [HTTP/1][] and HTTP/2. This API targets only the
2212+
**public API** of the [HTTP/1][]. However many modules use internal
22132213
methods or state, and those _are not supported_ as it is a completely
22142214
different implementation.
22152215

@@ -2237,7 +2237,7 @@ the status message for HTTP codes is ignored.
22372237

22382238
### ALPN negotiation
22392239

2240-
ALPN negotiation allows to support both [HTTPS][] and HTTP/2 over
2240+
ALPN negotiation allows supporting both [HTTPS][] and HTTP/2 over
22412241
the same socket. The `req` and `res` objects can be either HTTP/1 or
22422242
HTTP/2, and an application **must** restrict itself to the public API of
22432243
[HTTP/1][], and detect if it is possible to use the more advanced
@@ -2279,7 +2279,7 @@ added: v8.4.0
22792279

22802280
A `Http2ServerRequest` object is created by [`http2.Server`][] or
22812281
[`http2.SecureServer`][] and passed as the first argument to the
2282-
[`'request'`][] event. It may be used to access a request status, headers and
2282+
[`'request'`][] event. It may be used to access a request status, headers, and
22832283
data.
22842284

22852285
It implements the [Readable Stream][] interface, as well as the
@@ -2340,7 +2340,7 @@ console.log(request.headers);
23402340

23412341
See [Headers Object][].
23422342

2343-
*Note*: In HTTP/2, the request path, host name, protocol, and method are
2343+
*Note*: In HTTP/2, the request path, hostname, protocol, and method are
23442344
represented as special headers prefixed with the `:` character (e.g. `':path'`).
23452345
These special headers will be included in the `request.headers` object. Care
23462346
must be taken not to inadvertently modify these special headers or errors may
@@ -2373,7 +2373,7 @@ added: v8.4.0
23732373

23742374
* {string}
23752375

2376-
The request method as a string. Read only. Example:
2376+
The request method as a string. Read-only. Example:
23772377
`'GET'`, `'DELETE'`.
23782378

23792379
#### request.rawHeaders
@@ -3031,7 +3031,7 @@ If `name` is equal to `Http2Session`, the `PerformanceEntry` will contain the
30313031
following additional properties:
30323032

30333033
* `pingRTT` {number} The number of milliseconds elapsed since the transmission
3034-
of a `PING` frame and the reception of its acknowledgement. Only present if
3034+
of a `PING` frame and the reception of its acknowledgment. Only present if
30353035
a `PING` frame has been sent on the `Http2Session`.
30363036
* `streamCount` {number} The number of `Http2Stream` instances processed by
30373037
the `Http2Session`.

0 commit comments

Comments
 (0)