File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -1174,14 +1174,16 @@ added: v8.4.0
11741174* Returns: {undefined}
11751175
11761176Initiates a push stream. The callback is invoked with the new ` Http2Stream `
1177- instance created for the push stream.
1177+ instance created for the push stream passed as the second argument, or an
1178+ ` Error ` passed as the first argument.
11781179
11791180``` js
11801181const http2 = require (' http2' );
11811182const server = http2 .createServer ();
11821183server .on (' stream' , (stream ) => {
11831184 stream .respond ({ ' :status' : 200 });
1184- stream .pushStream ({ ' :path' : ' /' }, (pushStream ) => {
1185+ stream .pushStream ({ ' :path' : ' /' }, (err , pushStream ) => {
1186+ if (err) throw err;
11851187 pushStream .respond ({ ' :status' : 200 });
11861188 pushStream .end (' some pushed data' );
11871189 });
You can’t perform that action at this time.
0 commit comments