protein
Advanced tools
Comparing version 0.3.2 to 0.3.3
@@ -54,4 +54,6 @@ var http = require('http'); | ||
if (route) { | ||
if (req.url.substr(0, route.length) !== route) return loop(err); | ||
req.url = req.url.substr(route.length-1); | ||
if (url.substr(0, route.length) !== route) return loop(err); | ||
req.url = url.substr(route.length) || '/'; | ||
if (req.url[0] === '?') req.url = '/'+req.url; | ||
if (req.url[0] !== '/') return loop(err); | ||
} | ||
@@ -98,3 +100,3 @@ try { | ||
if (typeof fn === 'function') { | ||
fn.route = route && route.replace(/\/$/, '')+'/'; | ||
fn.route = route && route.replace(/\/$/, ''); | ||
stack.push(fn); | ||
@@ -101,0 +103,0 @@ } |
{ | ||
"name":"protein", | ||
"version":"0.3.2", | ||
"version":"0.3.3", | ||
"repository": "git://github.com/mafintosh/protein", | ||
@@ -5,0 +5,0 @@ "description":"Protein is connect compatible middleware with support for prototype methods, getters, and setters", |
@@ -45,2 +45,6 @@ var protein = require('../index'); | ||
}) | ||
.use('/myurl/more', function(req, res, next) { | ||
assert.equal(req.url, '/'); | ||
next(); | ||
}) | ||
.use(function(req, res) { | ||
@@ -47,0 +51,0 @@ complete = true; |
14795
340