You have to patch the request prototype and hook into the _addHeaderLine. 
It's not hard, but it's a bit hacky.

var http = require('http')
  , req = http.IncomingMessage.prototype;

var _addHeaderLine = req._addHeaderLine;

//Patch ServerRequest to save unmodified copy of headers
req._addHeaderLine = function(field, value) {
  var list = this.complete ?
    (this.allTrailers || (this.allTrailers = [])) :
    (this.allHeaders || (this.allHeaders = []));
  list.push(field + ': ' + value);
  _addHeaderLine.call(this, field, value);
};


Then you can access the unmodified headers in req.allHeaders. To put them 
back together obviously, just do req.allHeaders.join('\r\n').

Hope this helps.

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to