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

Commit 51c4388

Browse files
committed
getChatterFile should use the proxyUrl if it is set, required by Visualforce apps
1 parent a3180ec commit 51c4388

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

forcetk.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -199,13 +199,16 @@ if (forcetk.Client === undefined) {
199199
var url = this.instanceUrl + path;
200200

201201
var request = new XMLHttpRequest();
202-
203-
204-
request.open("GET", url, true);
202+
203+
204+
request.open("GET", (this.proxyUrl !== null) ? this.proxyUrl: url, true);
205205
request.responseType = "arraybuffer";
206206

207207
request.setRequestHeader(that.authzHeader, "OAuth " + that.sessionId);
208208
request.setRequestHeader('X-User-Agent', 'salesforce-toolkit-rest-javascript/' + that.apiVersion);
209+
if (that.proxyUrl !== null) {
210+
request.setRequestHeader('SalesforceProxy-Endpoint', url);
211+
}
209212

210213
request.onreadystatechange = function() {
211214
// continue if the process is completed

0 commit comments

Comments
 (0)