From 268afe34bb51448d511c9cd73c03e97d1c1baee0 Mon Sep 17 00:00:00 2001 From: srossross Date: Mon, 16 Sep 2013 10:37:11 -0700 Subject: [PATCH] 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 --- lib/caronte/index.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/caronte/index.js b/lib/caronte/index.js index 30db143f5..8a7e83742 100644 --- a/lib/caronte/index.js +++ b/lib/caronte/index.js @@ -1,5 +1,6 @@ var caronte = exports, - web = require('./passes/web-incoming'); + extend = require('util')._extend, + web = require('./passes/web-incoming'), ws = require('./passes/ws-incoming'); caronte.createWebProxy = createRightProxy('web'); @@ -41,7 +42,11 @@ function createRightProxy(type) { !(args[cntr] instanceof Buffer) && args[cntr] !== res ) { - options = args[cntr]; + //Copy global options + options = extend({}, options); + //Overwrite with request options + extend(options, args[cntr]); + cntr--; }