ENH: added 'headers' to available options, to add or overwrite existing headers

This commit is contained in:
srossross 2013-09-17 11:45:41 -07:00
parent 427d8d8536
commit 7d840d3515

View File

@ -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;
}