Skip to content

Commit

Permalink
Override route-binding options with req.options, instead of vice versa
Browse files Browse the repository at this point in the history
  • Loading branch information
sgress454 committed Sep 10, 2015
1 parent 417d772 commit 166e772
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/router/bind.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ function bindFunction(path, fn, verb, options) {
*/
var enhancedFn = function routeTargetFnWrapper(req, res, next) {

// Set req.options
req.options = _.merge(req.options || {}, options);
// Set req.options, using `options` to supply default values
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
Expand Down

0 comments on commit 166e772

Please sign in to comment.