Skip to content
Permalink
Browse files

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>
  • Loading branch information...
addaleax committed Jun 2, 2018
1 parent 2efe4c2 commit 65b17d4ddf3d104efdba837d6900ea893204b62a
Showing with 4 additions and 4 deletions.
  1. +4 −4 test/parallel/test-http2-respond-file.js
@@ -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'
}, {
@@ -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();

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

0 comments on commit 65b17d4

Please sign in to comment.
You can’t perform that action at this time.