From 996a2bb91eb190d30616ef205d3398da8f60eb81 Mon Sep 17 00:00:00 2001 From: Tim Caswell Date: Fri, 9 Apr 2010 02:16:55 -0500 Subject: [PATCH] Don't convert non-strings to strings by calling unescape on them. (Thanks orlandov) --- lib/node-router.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/node-router.js b/lib/node-router.js index 09715bb..d5df7d2 100644 --- a/lib/node-router.js +++ b/lib/node-router.js @@ -211,7 +211,9 @@ exports.getServer = function getServer(logger) { var match = path.match(route.pattern); if (match && match[0].length > 0) { match.shift(); - match = match.map(unescape); + match = match.map(function (part) { + return part ? unescape(part) : part; + }); match.unshift(res); match.unshift(req); if (route.format !== undefined) {