Skip to content

Commit

Permalink
Merge pull request #408 from rdingman/master
Browse files Browse the repository at this point in the history
Fix for issue #378. Properly save route on the request.
  • Loading branch information
mcavage committed Jun 7, 2013
2 parents 73c9c12 + 5da7a4f commit 29e846f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,9 @@ Server.prototype._handle = function _handle(req, res) {
self._route(req, res, function (route, context) {
req.context = req.params = context;
req.route = route.spec;
var chain = self.routes[route];

var r = route ? route.name : null;
var chain = self.routes[r];

self._run(req, res, route, chain, function done(e) {
self.emit('after', req, res, route, e);
Expand Down Expand Up @@ -628,7 +630,7 @@ Server.prototype._route = function _route(req, res, name, cb) {
err = new ResourceNotFoundError(req.path());
emitRouteError(self, res, res, err);
} else {
cb(r, ctx);
cb(route, ctx);
}
});
};
Expand Down

0 comments on commit 29e846f

Please sign in to comment.