Skip to content

Commit

Permalink
Fixing combineURLs, allowing single slash relatives
Browse files Browse the repository at this point in the history
  • Loading branch information
loklaan committed Dec 8, 2016
1 parent 2bd48d4 commit 8816bf6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/helpers/combineURLs.js
Expand Up @@ -8,8 +8,7 @@
* @returns {string} The combined URL
*/
module.exports = function combineURLs(baseURL, relativeURL) {
var end = relativeURL.replace(/^\/+/, '');
return end
? baseURL.replace(/\/+$/, '') + '/' + end
return relativeURL
? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+(.+)/, '$1')
: baseURL;
};

0 comments on commit 8816bf6

Please sign in to comment.