Skip to content

Commit 574d3b9

Browse files
nephrossevanlucas
authored andcommitted
doc: fix documentation of http2Stream.pushstream()
Improve documentation of callback signature of http2Stream.pushStream() function to align with the changes made in #17406. PR-URL: #18258 Fixes: #18198 Refs: #17406 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 4d3121b commit 574d3b9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

doc/api/http2.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1199,6 +1199,10 @@ added: v8.4.0
11991199
created stream is dependent on.
12001200
* `callback` {Function} Callback that is called once the push stream has been
12011201
initiated.
1202+
* `err` {Error}
1203+
* `pushStream` {[`ServerHttp2Stream`][]} The returned pushStream object.
1204+
* `headers` {[Headers Object][]} Headers object the pushStream was initiated
1205+
with.
12021206
* Returns: {undefined}
12031207

12041208
Initiates a push stream. The callback is invoked with the new `Http2Stream`
@@ -1210,7 +1214,7 @@ const http2 = require('http2');
12101214
const server = http2.createServer();
12111215
server.on('stream', (stream) => {
12121216
stream.respond({ ':status': 200 });
1213-
stream.pushStream({ ':path': '/' }, (err, pushStream) => {
1217+
stream.pushStream({ ':path': '/' }, (err, pushStream, headers) => {
12141218
if (err) throw err;
12151219
pushStream.respond({ ':status': 200 });
12161220
pushStream.end('some pushed data');

0 commit comments

Comments
 (0)