Skip to content

Commit 268afe3

Browse files
committed
ENH: updated ws and web functions to use the global options object as a base
even if request options is specified. request options will over write any global options in a conflict
1 parent 1b867a7 commit 268afe3

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Diff for: lib/caronte/index.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
var caronte = exports,
2-
web = require('./passes/web-incoming');
2+
extend = require('util')._extend,
3+
web = require('./passes/web-incoming'),
34
ws = require('./passes/ws-incoming');
45

56
caronte.createWebProxy = createRightProxy('web');
@@ -41,7 +42,11 @@ function createRightProxy(type) {
4142
!(args[cntr] instanceof Buffer) &&
4243
args[cntr] !== res
4344
) {
44-
options = args[cntr];
45+
//Copy global options
46+
options = extend({}, options);
47+
//Overwrite with request options
48+
extend(options, args[cntr]);
49+
4550
cntr--;
4651
}
4752

0 commit comments

Comments
 (0)