From 96a485736ffdd5a0fae2b3f0d9d566bb96f4c4ce Mon Sep 17 00:00:00 2001 From: Vadim Demedes Date: Wed, 13 Mar 2013 07:04:43 +0100 Subject: [PATCH] rollback of last commit --- lib/route66.coffee | 2 +- lib/route66.js | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/route66.coffee b/lib/route66.coffee index 826b112..6beb64d 100644 --- a/lib/route66.coffee +++ b/lib/route66.coffee @@ -44,7 +44,7 @@ Route66.addRoute = (method, route, functions) -> # generic method for adding rou Route66.routes[method].push route: route - regex: new RegExp('^' + route.replace(/\//g, '\\/').replace(/\:([A-Za-z_]+)(\?)?\/?/g, '$2([A-Za-z0-9@.=_-]+)$2') + '\\/?$') # making RegExp from string + regex: new RegExp('^' + route.replace(/\//g, '\\/').replace(/\:([A-Za-z_]+)(\?)?\/?/g, '$2([A-Za-z0-9@._-]+)$2') + '\\/?$') # making RegExp from string params: params functions: if functions instanceof Array then functions else toArray(functions).slice 1 diff --git a/lib/route66.js b/lib/route66.js index b54790b..dd06904 100644 --- a/lib/route66.js +++ b/lib/route66.js @@ -61,7 +61,7 @@ Route66.addRoute = function(method, route, functions) { } Route66.routes[method].push({ route: route, - regex: new RegExp('^' + route.replace(/\//g, '\\/').replace(/\:([A-Za-z_]+)(\?)?\/?/g, '$2([A-Za-z0-9@.=_-]+)$2') + '\\/?$'), + regex: new RegExp('^' + route.replace(/\//g, '\\/').replace(/\:([A-Za-z_]+)(\?)?\/?/g, '$2([A-Za-z0-9@._-]+)$2') + '\\/?$'), params: params, functions: functions instanceof Array ? functions : toArray(functions).slice(1) }); diff --git a/package.json b/package.json index 503e534..21815b1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "route66", - "version": "0.2.5", + "version": "0.2.7", "author": "Vadim Demedes ", "description": "Routing functionality/middleware for Connect 2.0", "main": "./index.js",