Skip to content

Commit

Permalink
test: minor adjustments to test-http2-respond-file
Browse files Browse the repository at this point in the history
PR-URL: nodejs#21098
Reviewed-By: Anatoli Papirovski <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Jon Moss <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
  • Loading branch information
addaleax authored and kjin committed Aug 23, 2018
1 parent 1322bea commit 9be7f75
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/parallel/test-http2-respond-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const data = fs.readFileSync(fname);
const stat = fs.statSync(fname);

const server = http2.createServer();
server.on('stream', (stream) => {
server.on('stream', common.mustCall((stream) => {
stream.respondWithFile(fname, {
[HTTP2_HEADER_CONTENT_TYPE]: 'text/plain'
}, {
Expand All @@ -28,9 +28,9 @@ server.on('stream', (stream) => {
headers[HTTP2_HEADER_CONTENT_LENGTH] = stat.size;
}
});
});
server.listen(0, () => {
}));

server.listen(0, common.mustCall(() => {
const client = http2.connect(`http://localhost:${server.address().port}`);
const req = client.request();

Expand All @@ -49,4 +49,4 @@ server.listen(0, () => {
server.close();
}));
req.end();
});
}));

0 comments on commit 9be7f75

Please sign in to comment.