diff --git a/forcetk.js b/forcetk.js index eb1d7f2..16ff1bb 100644 --- a/forcetk.js +++ b/forcetk.js @@ -57,10 +57,13 @@ if (forcetk.Client === undefined) { if (location.protocol === 'file:' || location.protocol === 'ms-appx:') { // In PhoneGap this.proxyUrl = null; - } else { + } else if (location.hostname.indexOf('force.com')>-1){ // In Visualforce - still need proxyUrl for Apex REST methods this.proxyUrl = location.protocol + "//" + location.hostname + "/services/proxy"; + } else { + //This means we are running locally, or on an external server, and we have CORS enabled (hopefully) + this.proxyUrl=null; } this.authzHeader = "Authorization"; } else {