From 5466b8b43f90ab4e7286e9f76074d34a5bbe00db Mon Sep 17 00:00:00 2001 From: Ivan Borisenko Date: Thu, 28 May 2015 00:22:11 +0000 Subject: [PATCH] Make convenient = false work. Without convenient = true, the convenient.final_response does nothing (returns undefined), so next msg.toBinary() call throws exception. As there is no another place in the code to encode and send response, this fix looks reasonable. --- server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server.js b/server.js index 0580ddf..bc0fcdc 100644 --- a/server.js +++ b/server.js @@ -217,7 +217,7 @@ Response.prototype.end = function(value) { var self = this var msg = convenient.final_response(self, value) - , data = msg.toBinary() + , data = msg ? msg.toBinary() : self.toBinary() if(self.connection.type == 'udp4' && data.length > 512) return self.emit('error', 'UDP responses greater than 512 bytes not yet implemented')