From 220a8e4f0e8690c0ab9a0ad8e34edc176febb716 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Nabais?= Date: Fri, 28 Feb 2014 12:39:27 +0000 Subject: [PATCH] Fix the combineUrl function * Allow a url to omit the protocol and use the same protocol as the * current page --- src/shared/util.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/shared/util.js b/src/shared/util.js index 312445565..587fbc0a3 100644 --- a/src/shared/util.js +++ b/src/shared/util.js @@ -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