Skip to content

Commit

Permalink
fix: don't create empty clientError listener for http.Server (#1895)
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelis committed Mar 23, 2022
1 parent 5c7eb95 commit ddc1042
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion lib/server.js
Expand Up @@ -142,7 +142,6 @@ function Server(options) {
this.acceptable = fmt.acceptable;
this.formatters = fmt.formatters;
this.proxyEvents = [
'clientError',
'close',
'connection',
'error',
Expand Down
4 changes: 2 additions & 2 deletions test/server.test.js
Expand Up @@ -2514,13 +2514,13 @@ test('should have proxy event handlers as instance', function(t) {
var server = restify.createServer({
handleUpgrades: false
});
t.equal(server.proxyEvents.length, 7);
t.equal(server.proxyEvents.length, 6);

server = restify.createServer({
handleUpgrades: true
});

t.equal(server.proxyEvents.length, 6);
t.equal(server.proxyEvents.length, 5);
server.close(function() {
t.end();
});
Expand Down

0 comments on commit ddc1042

Please sign in to comment.