Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ var utils = require('./utils');
*
* @api private
*/
function Entry(controller, action, pattern) {
function Entry(controller, action, pattern, method) {
this.controller = controller;
this.action = action;
this.pattern = pattern;
this.method = method;
// TODO: Implement support for 'sensitive' and 'strict' options
utils.pathRegexp(pattern, this.keys = []);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ Router.prototype._route = function(method, pattern, controller, action, helper)
// action. When building paths and URLs, routes declared first take priority.
// Therefore, if there is already an entry for this controller action in the
// table, don't overwrite it.
var entry = new Entry(controller, action, pattern);
var entry = new Entry(controller, action, pattern, method);
var key = entry.key();
if (!this._entries[key]) {
this._entries[key] = entry;
Expand Down