Skip to content

Commit 7d840d3

Browse files
committed
ENH: added 'headers' to available options, to add or overwrite existing headers
1 parent 427d8d8 commit 7d840d3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Diff for: lib/caronte/common.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
var common = exports
1+
var common = exports
22
, http = require('http')
33
, https = require('https')
4+
, extend = require('util')._extend
45
;
56

67
/**
@@ -35,6 +36,10 @@ common.setupOutgoing = function(outgoing, options, req, forward) {
3536
function(e) { outgoing[e] = req[e]; }
3637
);
3738

39+
if (options.headers){
40+
extend(outgoing.headers, options.headers);
41+
}
42+
3843
if (options.agent){
3944
outgoing.agent = options.agent;
4045
}

0 commit comments

Comments
 (0)