Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Changes to accomodate CORS support #70

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion forcetk.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down