From 7d840d35151be1aac612798754af47368594781d Mon Sep 17 00:00:00 2001 From: srossross Date: Tue, 17 Sep 2013 11:45:41 -0700 Subject: [PATCH] ENH: added 'headers' to available options, to add or overwrite existing headers --- lib/caronte/common.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/caronte/common.js b/lib/caronte/common.js index a272858..47ada1b 100644 --- a/lib/caronte/common.js +++ b/lib/caronte/common.js @@ -1,6 +1,7 @@ -var common = exports +var common = exports , http = require('http') , https = require('https') + , extend = require('util')._extend ; /** @@ -35,6 +36,10 @@ common.setupOutgoing = function(outgoing, options, req, forward) { function(e) { outgoing[e] = req[e]; } ); + if (options.headers){ + extend(outgoing.headers, options.headers); + } + if (options.agent){ outgoing.agent = options.agent; }