summaryrefslogtreecommitdiff
path: root/doc/api/http2.md
diff options
context:
space:
mode:
authorPeter Dalgaard-Jensen <nephross.cortex@gmail.com>2018-01-19 21:11:09 +0100
committerVse Mozhet Byt <vsemozhetbyt@gmail.com>2018-01-24 21:04:01 +0200
commitb886c424fb9ff7a5880d4a4c5a4d69ba5710c475 (patch)
tree0ac391d28331dddacb34a14189abaff05ecf8dbd /doc/api/http2.md
parent553d4ee57db12ef9f1c039985024c2e4f79fd815 (diff)
downloadandroid-node-v8-b886c424fb9ff7a5880d4a4c5a4d69ba5710c475.tar.gz
android-node-v8-b886c424fb9ff7a5880d4a4c5a4d69ba5710c475.tar.bz2
android-node-v8-b886c424fb9ff7a5880d4a4c5a4d69ba5710c475.zip
doc: fix documentation of http2Stream.pushstream()
Improve documentation of callback signature of http2Stream.pushStream() function to align with the changes made in https://github.com/nodejs/node/pull/17406. PR-URL: https://github.com/nodejs/node/pull/18258 Fixes: https://github.com/nodejs/node/issues/18198 Refs: https://github.com/nodejs/node/pull/17406 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'doc/api/http2.md')
-rw-r--r--doc/api/http2.md6
1 files changed, 5 insertions, 1 deletions
diff --git a/doc/api/http2.md b/doc/api/http2.md
index e79e46ac3e..e2f9aabfca 100644
--- a/doc/api/http2.md
+++ b/doc/api/http2.md
@@ -1199,6 +1199,10 @@ added: v8.4.0
created stream is dependent on.
* `callback` {Function} Callback that is called once the push stream has been
initiated.
+ * `err` {Error}
+ * `pushStream` {[`ServerHttp2Stream`][]} The returned pushStream object.
+ * `headers` {[Headers Object][]} Headers object the pushStream was initiated
+ with.
* Returns: {undefined}
Initiates a push stream. The callback is invoked with the new `Http2Stream`
@@ -1210,7 +1214,7 @@ const http2 = require('http2');
const server = http2.createServer();
server.on('stream', (stream) => {
stream.respond({ ':status': 200 });
- stream.pushStream({ ':path': '/' }, (err, pushStream) => {
+ stream.pushStream({ ':path': '/' }, (err, pushStream, headers) => {
if (err) throw err;
pushStream.respond({ ':status': 200 });
pushStream.end('some pushed data');