Skip to content

Commit

Permalink
[fix] Processing error code on abort connection (#562)
Browse files Browse the repository at this point in the history
Fixes #561
  • Loading branch information
shapel authored and darrachequesne committed Nov 2, 2018
1 parent 6a16ea1 commit bc7b239
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ Server.prototype.attach = function (server, options) {

function abortConnection (socket, code) {
if (socket.writable) {
var message = Server.errorMessages.hasOwnProperty(code) ? Server.errorMessages[code] : (code || '');
var message = Server.errorMessages.hasOwnProperty(code) ? Server.errorMessages[code] : String(code || '');
var length = Buffer.byteLength(message);
socket.write(
'HTTP/1.1 400 Bad Request\r\n' +
Expand Down

0 comments on commit bc7b239

Please sign in to comment.