Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

moved away from path.join for building uri and regular expressions. #67

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions lib/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -71,15 +71,15 @@ 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
}
},

filePath: function(fpath){
return path.join(config.scope, fpath)
return config.scope + '/' + fpath;
},

/**
Expand Down Expand Up @@ -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

Expand Down