Merge pull request #4357 from d3x7r0/master

Allow a url to omit the protocol
This commit is contained in:
Yury Delendik 2014-02-28 14:32:19 -06:00
commit 5c40d686d4

View File

@ -228,7 +228,11 @@ function combineUrl(baseUrl, url) {
if (url.charAt(0) == '/') {
// absolute path
var i = baseUrl.indexOf('://');
i = baseUrl.indexOf('/', i + 3);
if (url.charAt(1) === '/') {
++i;
} else {
i = baseUrl.indexOf('/', i + 3);
}
return baseUrl.substring(0, i) + url;
} else {
// relative path