mirror of https://github.com/nodejs/node.git
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
parent
9fe39ede9f
commit
9a998d5e24
|
@ -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':
|
||||
|
|
Loading…
Reference in New Issue