From c534dcb01564a052866cd7334e4c4cc4373723ec Mon Sep 17 00:00:00 2001 From: Ujjwal Sharma Date: Tue, 8 May 2018 17:59:14 +0530 Subject: [PATCH 1/2] doc: add params for ClientHttp2Session:altsvc Add parameters for the callback for the ClientHttp2Session:altsvc event inline with the pattern in the rest of the documentation. Refs: https://github.com/nodejs/help/issues/877#issuecomment-381253464 --- doc/api/http2.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/api/http2.md b/doc/api/http2.md index a8f762173404f1..36b5fc356d0913 100644 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -664,23 +664,23 @@ added: v8.4.0 added: v9.4.0 --> -* `alt`: {string} -* `origin`: {string} -* `streamId`: {number} +* `alt` {string} +* `origin` {string} +* `stream` {number} The `'altsvc'` event is emitted whenever an `ALTSVC` frame is received by -the client. The event is emitted with the `ALTSVC` value, origin, and stream -ID. If no `origin` is provided in the `ALTSVC` frame, `origin` will +the client. The event is emitted with the `ALTSVC` value, origin, and stream. +If no `origin` is provided in the `ALTSVC` frame, `origin` will be an empty string. ```js const http2 = require('http2'); const client = http2.connect('https://example.org'); -client.on('altsvc', (alt, origin, streamId) => { +client.on('altsvc', (alt, origin, stream) => { console.log(alt); console.log(origin); - console.log(streamId); + console.log(stream); }); ``` From 7d16a2784ff686ea6018afe92a68b2a17d921746 Mon Sep 17 00:00:00 2001 From: Ujjwal Sharma Date: Wed, 9 May 2018 01:02:28 +0530 Subject: [PATCH 2/2] fixup! doc: add params for ClientHttp2Session:altsvc --- doc/api/http2.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/api/http2.md b/doc/api/http2.md index 36b5fc356d0913..565212687dba95 100644 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -666,21 +666,21 @@ added: v9.4.0 * `alt` {string} * `origin` {string} -* `stream` {number} +* `streamId` {number} The `'altsvc'` event is emitted whenever an `ALTSVC` frame is received by -the client. The event is emitted with the `ALTSVC` value, origin, and stream. -If no `origin` is provided in the `ALTSVC` frame, `origin` will +the client. The event is emitted with the `ALTSVC` value, origin, and stream +ID. If no `origin` is provided in the `ALTSVC` frame, `origin` will be an empty string. ```js const http2 = require('http2'); const client = http2.connect('https://example.org'); -client.on('altsvc', (alt, origin, stream) => { +client.on('altsvc', (alt, origin, streamId) => { console.log(alt); console.log(origin); - console.log(stream); + console.log(streamId); }); ```