http: don't lowercase http req header until later

Don't lowercase the request header until we're in the _addHeaderLine method,
makes it easier to intercept the raw request headers.
pull/24503/head
Simon Sturmer 2012-06-01 17:33:19 +10:00 committed by Ben Noordhuis
parent 9fe39ede9f
commit 9a998d5e24
1 changed files with 3 additions and 2 deletions

View File

@ -87,7 +87,7 @@ function parserOnHeadersComplete(info) {
for (var i = 0; i < n; i += 2) {
var k = headers[i];
var v = headers[i + 1];
parser.incoming._addHeaderLine(k.toLowerCase(), v);
parser.incoming._addHeaderLine(k, v);
}
@ -134,7 +134,7 @@ function parserOnMessageComplete() {
for (var i = 0, n = headers.length; i < n; i += 2) {
var k = headers[i];
var v = headers[i + 1];
parser.incoming._addHeaderLine(k.toLowerCase(), v);
parser.incoming._addHeaderLine(k, v);
}
parser._headers = [];
parser._url = '';
@ -380,6 +380,7 @@ IncomingMessage.prototype._emitEnd = function() {
IncomingMessage.prototype._addHeaderLine = function(field, value) {
var dest = this.complete ? this.trailers : this.headers;
field = field.toLowerCase();
switch (field) {
// Array headers:
case 'set-cookie':