diff --git a/lib/_http_incoming.js b/lib/_http_incoming.js index 5c04ab9dfe3331..d02f19424c0442 100644 --- a/lib/_http_incoming.js +++ b/lib/_http_incoming.js @@ -103,21 +103,17 @@ IncomingMessage.prototype.destroy = function destroy(error) { IncomingMessage.prototype._addHeaderLines = _addHeaderLines; function _addHeaderLines(headers, n) { if (headers && headers.length) { - var raw, dest; + var dest; if (this.complete) { - raw = this.rawTrailers; + this.rawTrailers = headers; dest = this.trailers; } else { - raw = this.rawHeaders; + this.rawHeaders = headers; dest = this.headers; } for (var i = 0; i < n; i += 2) { - var k = headers[i]; - var v = headers[i + 1]; - raw.push(k); - raw.push(v); - this._addHeaderLine(k, v, dest); + this._addHeaderLine(headers[i], headers[i + 1], dest); } } }