Skip to content

Commit bd0d19d

Browse files
addaleaxMylesBorins
authored andcommitted
test: minor adjustments to test-http2-respond-file
PR-URL: #21098 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
1 parent c4fc1ff commit bd0d19d

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎test/parallel/test-http2-respond-file.js‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const data = fs.readFileSync(fname);
1919
conststat=fs.statSync(fname);
2020

2121
constserver=http2.createServer();
22-
server.on('stream',(stream)=>{
22+
server.on('stream',common.mustCall((stream)=>{
2323
stream.respondWithFile(fname,{
2424
[HTTP2_HEADER_CONTENT_TYPE]: 'text/plain'
2525
},{
@@ -28,9 +28,9 @@ server.on('stream', (stream) => {
2828
headers[HTTP2_HEADER_CONTENT_LENGTH]=stat.size;
2929
}
3030
});
31-
});
32-
server.listen(0,()=>{
31+
}));
3332

33+
server.listen(0,common.mustCall(()=>{
3434
constclient=http2.connect(`http://localhost:${server.address().port}`);
3535
constreq=client.request();
3636

@@ -49,4 +49,4 @@ server.listen(0, () => {
4949
server.close();
5050
}));
5151
req.end();
52-
});
52+
}));

0 commit comments

Comments
 (0)