cdnify.js line 26
function joinBaseAndPath(base, urlPath) {
// Split out protocol first, to avoid '//' getting normalized to '/'
var bits = base.split('//'),
protocol = bits[0], rest = bits[1];
if (!rest) {
protocol = null;
rest = bits[0];
}
// Trim any path off if this is a domain-relative URL
if (urlPath[0] === '/')
rest = rest.split('/')[0];
// Join it all together
return (protocol ? protocol + '//' : '') + path.normalize("" + rest + "/" + urlPath);
}