From 3eb894ee852ab74f578cf88e67cdb2aa8cd43e50 Mon Sep 17 00:00:00 2001 From: Jonathan Ong Date: Mon, 30 Dec 2013 22:25:44 -0800 Subject: [PATCH] res: 205 is a no body response code too! MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit not sure anyone cares enough about this for a test. plus, it’ll still “work” --- lib/response.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/response.js b/lib/response.js index 0cd29cb..1bda677 100644 --- a/lib/response.js +++ b/lib/response.js @@ -78,8 +78,7 @@ module.exports = { } this._status = this.res.statusCode = val; - var noContent = 304 == val || 204 == val; - if (noContent && this.body) this.body = null; + if (this.body && ~[204, 205, 304].indexOf(val)) this.body = null; }, /**