diff --git a/lib/entry.js b/lib/entry.js index 9c7859a..a8029d9 100644 --- a/lib/entry.js +++ b/lib/entry.js @@ -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 = []); } diff --git a/lib/router.js b/lib/router.js index a60b408..7e1bac9 100644 --- a/lib/router.js +++ b/lib/router.js @@ -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;