mirror of
https://github.com/zebrajr/express.git
synced 2025-12-06 12:19:51 +01:00
Added condition iteration
This commit is contained in:
parent
5b38d16d80
commit
dcd640d2b9
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user