Skip to content
Myr

Fixed route method matching

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by visionmedia · committed by visionmedia · parent aed14b6 · Browse files · 2 files+1 added−24 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+1 added−24 removed

  • tests:+0 added−7 removed
  • other:+1 added−17 removed

2 files+1 added−24 removed

modified:lib/express.core.js+1 added-17 removed
461 unmodified lines
462 return Array.prototype.slice.call(args, offset)463 },464 465 /**466 * Check if _route_ matches the proper _request_ method.467 *468 * @param {hash} route469 * @param {hash} request470 * @return {bool}471 * @api private472 */473 474 routeMethod : function(route, request) {475 return route.method.toUpperCase() == request.method476 },477 478 /**466 * Check if _route_ matches provides the proper467 * encoding types listed in _request_'s Accept header.468 *469 * @param {hash} route
53 unmodified lines
523 * @api private524 */525 526 routeMatches : function(route, request) {540 // var conditions = [Express.routeMethod]541 // for (i = 0, len = conditions.length; i < len; ++i)542 // if (!conditions[i](route, request))543 // return false527 if (request.method.toLowerCase() != route.method) return false528 switch (route.path.constructor) {529 case String: return route.path == request.uri.path530 case RegExp: return !! (Express.captures = request.uri.path.match(route.path))531 }
53 unmodified lines
modified:spec/spec.routing.js-7 removed