Skip to content

Commit

Permalink
doc: rename HTTP2 to HTTP/2
Browse files Browse the repository at this point in the history
Previously, "HTTP/2" was strictly used to describe the protocol, and
HTTP2 the module. This distinction is deemed unnecessary, and
consistency between the two terms is enforced.

Backport-PR-URL: #20456
PR-URL: #19603
Reviewed-By: Vse Mozhet Byt <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Chen Gang <[email protected]>
Reviewed-By: Shingo Inoue <[email protected]>
  • Loading branch information
TimothyGu authored and MylesBorins committed May 15, 2018
1 parent e4c10e1 commit f59eab0
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 34 deletions.
62 changes: 30 additions & 32 deletions doc/api/http2.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# HTTP2
# HTTP/2

<!--introduced_in=v8.4.0-->

Expand Down Expand Up @@ -230,7 +230,7 @@ added: v8.4.0

The `'stream'` event is emitted when a new `Http2Stream` is created. When
invoked, the handler function will receive a reference to the `Http2Stream`
object, a [HTTP2 Headers Object][], and numeric flags associated with the
object, a [HTTP/2 Headers Object][], and numeric flags associated with the
creation of the stream.

```js
Expand Down Expand Up @@ -383,7 +383,7 @@ Transmits a `GOAWAY` frame to the connected peer *without* shutting down the
added: v8.4.0
-->

* Value: {HTTP2 Settings Object}
* Value: {HTTP/2 Settings Object}

A prototype-less object describing the current local settings of this
`Http2Session`. The local settings are local to *this* `Http2Session` instance.
Expand Down Expand Up @@ -462,7 +462,7 @@ instance's underlying [`net.Socket`].
added: v8.4.0
-->

* Value: {HTTP2 Settings Object}
* Value: {HTTP/2 Settings Object}

A prototype-less object describing the current remote settings of this
`Http2Session`. The remote settings are set by the *connected* HTTP/2 peer.
Expand Down Expand Up @@ -533,8 +533,7 @@ An object describing the current status of this `Http2Session`.
added: v8.4.0
-->

* `settings` {HTTP2 Settings Object}
* Returns {undefined}
* `settings` {HTTP/2 Settings Object}

Updates the current local settings for this `Http2Session` and sends a new
`SETTINGS` frame to the connected HTTP/2 peer.
Expand Down Expand Up @@ -674,7 +673,7 @@ client.on('altsvc', (alt, origin, streamId) => {
added: v8.4.0
-->

* `headers` {HTTP2 Headers Object}
* `headers` {HTTP/2 Headers Object}
* `options` {Object}
* `endStream` {boolean} `true` if the `Http2Stream` *writable* side should
be closed initially, such as when sending a `GET` request that should not
Expand Down Expand Up @@ -862,7 +861,7 @@ added: v8.4.0

The `'trailers'` event is emitted when a block of headers associated with
trailing header fields is received. The listener callback is passed the
[HTTP2 Headers Object][] and flags associated with the headers.
[HTTP/2 Headers Object][] and flags associated with the headers.

```js
stream.on('trailers', (headers, flags) => {
Expand Down Expand Up @@ -961,7 +960,7 @@ calling `http2stream.close()`, or `http2stream.destroy()`. Will be
added: REPLACEME
-->

* Value: {HTTP2 Headers Object}
* Value: {HTTP/2 Headers Object}

An object containing the outbound headers sent for this `Http2Stream`.

Expand All @@ -970,7 +969,7 @@ An object containing the outbound headers sent for this `Http2Stream`.
added: REPLACEME
-->

* Value: {HTTP2 Headers Object[]}
* Value: {HTTP/2 Headers Object[]}

An array of objects containing the outbound informational (additional) headers
sent for this `Http2Stream`.
Expand All @@ -980,7 +979,7 @@ sent for this `Http2Stream`.
added: REPLACEME
-->

* Value: {HTTP2 Headers Object}
* Value: {HTTP/2 Headers Object}

An object containing the outbound trailers sent for this this `HttpStream`.

Expand Down Expand Up @@ -1063,7 +1062,7 @@ added: v8.4.0

The `'headers'` event is emitted when an additional block of headers is received
for a stream, such as when a block of `1xx` informational headers is received.
The listener callback is passed the [HTTP2 Headers Object][] and flags
The listener callback is passed the [HTTP/2 Headers Object][] and flags
associated with the headers.

```js
Expand All @@ -1078,7 +1077,7 @@ added: v8.4.0
-->

The `'push'` event is emitted when response headers for a Server Push stream
are received. The listener callback is passed the [HTTP2 Headers Object][] and
are received. The listener callback is passed the [HTTP/2 Headers Object][] and
flags associated with the headers.

```js
Expand All @@ -1095,7 +1094,7 @@ added: v8.4.0
The `'response'` event is emitted when a response `HEADERS` frame has been
received for this stream from the connected HTTP/2 server. The listener is
invoked with two arguments: an Object containing the received
[HTTP2 Headers Object][], and flags associated with the headers.
[HTTP/2 Headers Object][], and flags associated with the headers.

For example:

Expand Down Expand Up @@ -1125,8 +1124,7 @@ provide additional methods such as `http2stream.pushStream()` and
added: v8.4.0
-->

* `headers` {HTTP2 Headers Object}
* Returns: {undefined}
* `headers` {HTTP/2 Headers Object}

Sends an additional informational `HEADERS` frame to the connected HTTP/2 peer.

Expand Down Expand Up @@ -1156,7 +1154,7 @@ accepts push streams, `false` otherwise. Settings are the same for every
added: v8.4.0
-->

* `headers` {HTTP2 Headers Object}
* `headers` {HTTP/2 Headers Object}
* `options` {Object}
* `exclusive` {boolean} When `true` and `parent` identifies a parent Stream,
the created stream is made the sole direct dependency of the parent, with
Expand All @@ -1168,7 +1166,7 @@ added: v8.4.0
initiated.
* `err` {Error}
* `pushStream` {ServerHttp2Stream} The returned pushStream object.
* `headers` {HTTP2 Headers Object} Headers object the pushStream was
* `headers` {HTTP/2 Headers Object} Headers object the pushStream was
initiated with.
* Returns: {undefined}

Expand Down Expand Up @@ -1199,7 +1197,7 @@ a `weight` value to `http2stream.priority` with the `silent` option set to
added: v8.4.0
-->

* `headers` {HTTP2 Headers Object}
* `headers` {HTTP/2 Headers Object}
* `options` {Object}
* `endStream` {boolean} Set to `true` to indicate that the response will not
include payload data.
Expand Down Expand Up @@ -1245,7 +1243,7 @@ added: v8.4.0
-->

* `fd` {number} A readable file descriptor.
* `headers` {HTTP2 Headers Object}
* `headers` {HTTP/2 Headers Object}
* `options` {Object}
* `statCheck` {Function}
* `getTrailers` {Function} Callback function invoked to collect trailer
Expand Down Expand Up @@ -1336,7 +1334,7 @@ added: v8.4.0
-->

* `path` {string|Buffer|URL}
* `headers` {HTTP2 Headers Object}
* `headers` {HTTP/2 Headers Object}
* `options` {Object}
* `statCheck` {Function}
* `onError` {Function} Callback function invoked in the case of an
Expand Down Expand Up @@ -1712,7 +1710,7 @@ changes:
* `selectPadding` {Function} When `options.paddingStrategy` is equal to
`http2.constants.PADDING_STRATEGY_CALLBACK`, provides the callback function
used to determine the padding. See [Using options.selectPadding][].
* `settings` {HTTP2 Settings Object} The initial settings to send to the
* `settings` {HTTP/2 Settings Object} The initial settings to send to the
remote peer upon connection.
* `onRequestHandler` {Function} See [Compatibility API][]
* Returns: {Http2Server}
Expand Down Expand Up @@ -1807,7 +1805,7 @@ changes:
* `selectPadding` {Function} When `options.paddingStrategy` is equal to
`http2.constants.PADDING_STRATEGY_CALLBACK`, provides the callback function
used to determine the padding. See [Using options.selectPadding][].
* `settings` {HTTP2 Settings Object} The initial settings to send to the
* `settings` {HTTP/2 Settings Object} The initial settings to send to the
remote peer upon connection.
* ...: Any [`tls.createServer()`][] options can be provided. For
servers, the identity options (`pfx` or `key`/`cert`) are usually required.
Expand Down Expand Up @@ -1903,7 +1901,7 @@ changes:
* `selectPadding` {Function} When `options.paddingStrategy` is equal to
`http2.constants.PADDING_STRATEGY_CALLBACK`, provides the callback function
used to determine the padding. See [Using options.selectPadding][].
* `settings` {HTTP2 Settings Object} The initial settings to send to the
* `settings` {HTTP/2 Settings Object} The initial settings to send to the
remote peer upon connection.
* `createConnection` {Function} An optional callback that receives the `URL`
instance passed to `connect` and the `options` object, and returns any
Expand Down Expand Up @@ -1956,7 +1954,7 @@ a given number of milliseconds set using `http2server.setTimeout()`.
added: v8.4.0
-->

* Returns: {HTTP2 Settings Object}
* Returns: {HTTP/2 Settings Object}

Returns an object containing the default settings for an `Http2Session`
instance. This method returns a new object instance every time it is called
Expand All @@ -1967,7 +1965,7 @@ so instances returned may be safely modified for use.
added: v8.4.0
-->

* `settings` {HTTP2 Settings Object}
* `settings` {HTTP/2 Settings Object}
* Returns: {Buffer}

Returns a `Buffer` instance containing serialized representation of the given
Expand All @@ -1989,9 +1987,9 @@ added: v8.4.0
-->

* `buf` {Buffer|Uint8Array} The packed settings.
* Returns: {HTTP2 Settings Object}
* Returns: {HTTP/2 Settings Object}

Returns a [HTTP2 Settings Object][] containing the deserialized settings from
Returns a [HTTP/2 Settings Object][] containing the deserialized settings from
the given `Buffer` as generated by `http2.getPackedSettings()`.

### Headers Object
Expand Down Expand Up @@ -2256,7 +2254,7 @@ In order to create a mixed [HTTPS][] and HTTP/2 server, refer to the
[ALPN negotiation][] section.
Upgrading from non-tls HTTP/1 servers is not supported.

The HTTP2 compatibility API is composed of [`Http2ServerRequest`]() and
The HTTP/2 compatibility API is composed of [`Http2ServerRequest`]() and
[`Http2ServerResponse`](). They aim at API compatibility with HTTP/1, but
they do not hide the differences between the protocols. As an example,
the status message for HTTP codes is ignored.
Expand Down Expand Up @@ -2364,7 +2362,7 @@ Example:
console.log(request.headers);
```

See [HTTP2 Headers Object][].
See [HTTP/2 Headers Object][].

*Note*: In HTTP/2, the request path, hostname, protocol, and method are
represented as special headers prefixed with the `:` character (e.g. `':path'`).
Expand Down Expand Up @@ -3087,8 +3085,8 @@ following additional properties:
[HTTP/1]: http.html
[HTTP/2]: https://tools.ietf.org/html/rfc7540
[HTTP/2 Unencrypted]: https://http2.github.io/faq/#does-http2-require-encryption
[HTTP2 Headers Object]: #http2_headers_object
[HTTP2 Settings Object]: #http2_settings_object
[HTTP/2 Headers Object]: #http2_headers_object
[HTTP/2 Settings Object]: #http2_settings_object
[HTTPS]: https.html
[Http2Session and Sockets]: #http2_http2session_and_sockets
[Performance Observer]: perf_hooks.html
Expand Down
4 changes: 2 additions & 2 deletions tools/doc/type-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ const typeMap = {
'http.ServerResponse': 'http.html#http_class_http_serverresponse',

'ClientHttp2Stream': 'http2.html#http2_class_clienthttp2stream',
'HTTP2 Headers Object': 'http2.html#http2_headers_object',
'HTTP2 Settings Object': 'http2.html#http2_settings_object',
'HTTP/2 Headers Object': 'http2.html#http2_headers_object',
'HTTP/2 Settings Object': 'http2.html#http2_settings_object',
'http2.Http2ServerRequest': 'http2.html#http2_class_http2_http2serverrequest',
'http2.Http2ServerResponse':
'http2.html#http2_class_http2_http2serverresponse',
Expand Down

0 comments on commit f59eab0

Please sign in to comment.