Browse Source

http: Improve _addHeaderLines method

Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
v0.11.15-release
Jackson Tian 10 years ago
committed by Chris Dickinson
parent
commit
1781c8b85b
  1. 3
      lib/_http_incoming.js

3
lib/_http_incoming.js

@ -125,11 +125,12 @@ IncomingMessage.prototype._addHeaderLines = function(headers, n) {
raw = this.rawHeaders; raw = this.rawHeaders;
dest = this.headers; dest = this.headers;
} }
raw.push.apply(raw, headers);
for (var i = 0; i < n; i += 2) { for (var i = 0; i < n; i += 2) {
var k = headers[i]; var k = headers[i];
var v = headers[i + 1]; var v = headers[i + 1];
raw.push(k);
raw.push(v);
this._addHeaderLine(k, v, dest); this._addHeaderLine(k, v, dest);
} }
} }

Loading…
Cancel
Save