From dfa2765a2a93c859c518d569daa99745b07d7e84 Mon Sep 17 00:00:00 2001 From: Scott Gress Date: Mon, 25 Jan 2016 16:10:05 -0600 Subject: [PATCH] Ensure req.options is always a new object. refs #3500 --- lib/router/bind.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/router/bind.js b/lib/router/bind.js index 255c54ad79..8dd32f1617 100644 --- a/lib/router/bind.js +++ b/lib/router/bind.js @@ -158,7 +158,7 @@ function bindFunction(path, fn, verb, options) { var enhancedFn = function routeTargetFnWrapper(req, res, next) { // Set req.options, using `options` to supply default values - req.options = _.merge(options || {}, req.options || {}); + req.options = _.merge({}, options || {}, req.options || {}); // This event can be tapped into to take control of logic // that should be run before each middleware function