Added condition iteration

This commit is contained in:
visionmedia 2009-07-01 09:22:06 -07:00
parent 5b38d16d80
commit dcd640d2b9

View File

@ -319,10 +319,10 @@
*/
routeMatches : function(route, request) {
// var conditions = [Express.routeMethod, Express.routeProvides]
// for (i = 0, len = conditions.length; i < len; ++i)
// if (!conditions[i](route, request))
// return false
var conditions = [Express.routeMethod]
for (i = 0, len = conditions.length; i < len; ++i)
if (!conditions[i](route, request))
return false
switch (route.path.constructor) {
case String: return route.path == request.uri.path
case RegExp: return !! (Express.captures = request.uri.path.match(route.path))