Permalink
Browse files

Ensuring urls is a string in helpers

  • Loading branch information...
1 parent 2f38388 commit aa8bd7b8ee2ae48f76c57583039fe92867e36f0e @serby committed Jan 31, 2012
Showing with 2 additions and 1 deletion.
  1. +1 −0 lib/middleware/basic.js
  2. +1 −1 lib/middleware/mapped.js
View
@@ -14,6 +14,7 @@ module.exports = function(version) {
* This is intended to be exported as a helper for the view layer
*/
versionPath: function(urlPath) {
+ urlPath = urlPath.toString();
var pos = urlPath.lastIndexOf('/');
if (pos !== -1) {
return path.normalize(urlPath.substring(0, pos) + '/' + version + urlPath.substring(pos));
View
@@ -17,7 +17,7 @@ module.exports = function(mappedPaths) {
* This is intended to be exported as a helper for the view layer
*/
versionPath: function(url) {
- return mappedPaths[url] || url;
+ return mappedPaths[url.toString()] || url;
},
middleware: function(req, res, next) {

0 comments on commit aa8bd7b

Please sign in to comment.