Skip to content

Commit 54a55bf

Browse files
committed
http: fix test where aborted should not be emitted
1 parent 2976bbd commit 54a55bf

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

lib/_http_common.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,7 @@
2424
const { Math } = primordials;
2525
const { setImmediate } = require('timers');
2626

27-
const { getOptionValue } = require('internal/options');
28-
29-
const { methods, HTTPParser } =
30-
getOptionValue('--http-parser') === 'legacy' ?
31-
internalBinding('http_parser') : internalBinding('http_parser_llhttp');
27+
const { methods, HTTPParser } = internalBinding('http_parser');
3228

3329
const FreeList = require('internal/freelist');
3430
const { ondrain } = require('internal/http');

test/parallel/test-http-response-no-headers.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ function test(httpVersion, callback) {
5151
body += data;
5252
});
5353

54+
res.on('aborted', common.mustNotCall());
5455
res.on('end', common.mustCall(function() {
5556
assert.strictEqual(body, expected[httpVersion]);
5657
server.close();

test/parallel/test-http-response-status-message.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
// USE OR OTHER DEALINGS IN THE SOFTWARE.
2121

2222
'use strict';
23-
require('../common');
23+
const common = require('../common');
2424
const assert = require('assert');
2525
const http = require('http');
2626
const net = require('net');
@@ -71,6 +71,7 @@ function runTest(testCaseIndex) {
7171
console.log(`client: actual status message: ${response.statusMessage}`);
7272
assert.strictEqual(testCase.statusMessage, response.statusMessage);
7373

74+
response.on('aborted', common.mustNotCall());
7475
response.on('end', function() {
7576
countdown.dec();
7677
if (testCaseIndex + 1 < testCases.length) {

0 commit comments

Comments
 (0)