From b358945185b6fef3a0a39475fa4b5b1a07783022 Mon Sep 17 00:00:00 2001 From: nerdylikeme Date: Wed, 1 May 2013 21:19:50 -0400 Subject: [PATCH] avoiding path.join for building uri's as this api uses a platform specific separator. --- lib/helpers.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/helpers.js b/lib/helpers.js index e532ffd..e9fb7bc 100644 --- a/lib/helpers.js +++ b/lib/helpers.js @@ -19,7 +19,7 @@ module.exports = function(config){ }, parseJSON: function(str) { - var scopePath = path.join("/", scope) + var scopePath = "/" + scope; var rx = RegExp("^" + scopePath, "i") try { @@ -71,7 +71,7 @@ module.exports = function(config){ scopedPath: function(fpath){ if(scope){ - var rx = RegExp("^" + path.join("/", scope)) + var rx = RegExp("^" + "/" + scope) return fpath.replace(rx, "") }else{ return fpath @@ -79,7 +79,7 @@ module.exports = function(config){ }, filePath: function(fpath){ - return path.join(config.scope, fpath) + return config.scope + '/' + fpath; }, /** @@ -120,13 +120,13 @@ module.exports = function(config){ var filepath = obj.path ? qs.escape(obj.path) : "" // build full path - var fullpath = path.join(obj.hostname) - fullpath = path.join(fullpath, obj.version || "1") - fullpath = path.join(fullpath, obj.action) - fullpath = path.join(fullpath, rootpath) - fullpath = path.join(fullpath, scopepath) - fullpath = path.join(fullpath, filepath) - + var fullpath = obj.hostname; + fullpath += '/' + (obj.version || "1"); + fullpath += '/' + obj.action; + fullpath += '/' + rootpath; + fullpath += '/' + scopepath; + fullpath += filepath; + // add protocol var fullurl = "https://" + fullpath