diff --git a/lib/helpers.js b/lib/helpers.js index bcc24c6..e532ffd 100644 --- a/lib/helpers.js +++ b/lib/helpers.js @@ -5,7 +5,7 @@ var qs = require("querystring") module.exports = function(config){ var root = config.root || "sandbox" var signer = oauth(config.app_key, config.app_secret) - var scope = config.scope + var scope = config.scope = config.scope || "" return { sign: function(token, args){ @@ -111,13 +111,13 @@ module.exports = function(config){ var fileop = obj.action.split("/")[0] == "fileops" // fileops calls desn't want root in path - var rootpath = fileop ? null : root + var rootpath = fileop ? "" : root // fileops calls desn't want scope in path - var scopepath = fileop ? null : scope + var scopepath = fileop ? "" : scope // we wont always have this - var filepath = obj.path ? qs.escape(obj.path) : null + var filepath = obj.path ? qs.escape(obj.path) : "" // build full path var fullpath = path.join(obj.hostname)