From af2558ed5d1486668174e608a2889d099cc70edc Mon Sep 17 00:00:00 2001 From: Christian Schneider Date: Fri, 10 Oct 2014 15:50:16 +0200 Subject: Allow omission of url scheme and accept https as well --- itjs/http.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'itjs') diff --git a/itjs/http.js b/itjs/http.js index 5773cda..9f1bd4b 100755 --- a/itjs/http.js +++ b/itjs/http.js @@ -52,7 +52,7 @@ send: function(url, method, postdata) this.busy = true; this.req = null; - var samehost = (url.indexOf('http://') < 0 || url.indexOf(window.location.hostname) > 0); + var samehost = (!url.match(/^(\w+:)?\/\//) || url.indexOf(window.location.hostname) > 0); if (samehost) // use XMLHTTP request only if on same host { -- cgit v1.2.3