diff --git a/lib/response.js b/lib/response.js index 3ea3727..844c137 100644 --- a/lib/response.js +++ b/lib/response.js @@ -440,15 +440,14 @@ module.exports = { append: function(field, val){ var prev = this.get(field); - var value = val; + if (prev) { - // concat the new and prev vals - value = Array.isArray(prev) ? prev.concat(val) - : Array.isArray(val) ? [prev].concat(val) - : [prev, val]; + val = Array.isArray(prev) + ? prev.concat(val) + : [prev].concat(val); } - return this.set(field, value); + return this.set(field, val); }, /**