http: Improve _addHeaderLines method
authorJackson Tian <shyvo1987@gmail.com>
Wed, 24 Sep 2014 05:14:48 +0000 (13:14 +0800)
committerChris Dickinson <christopher.s.dickinson@gmail.com>
Wed, 1 Oct 2014 00:00:29 +0000 (17:00 -0700)
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
lib/_http_incoming.js

index b31754d..69d3d86 100644 (file)
@@ -125,11 +125,12 @@ IncomingMessage.prototype._addHeaderLines = function(headers, n) {
       raw = this.rawHeaders;
       dest = this.headers;
     }
-    raw.push.apply(raw, 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);
     }
   }