Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions lib/_http_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -399,9 +399,6 @@ function socketErrorListener(err) {
req.emit('error', err);
}

// Handle any pending data
socket.read();

const parser = socket.parser;
if (parser) {
parser.finish();
Expand Down
3 changes: 2 additions & 1 deletion test/parallel/test-http-client-read-in-error.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
require('../common');
const common = require('../common');
const net = require('net');
const http = require('http');

Expand Down Expand Up @@ -37,4 +37,5 @@ http.request({
agent
}).once('error', function() {
console.log('ignore');
this.on('data', common.mustNotCall());
});