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

Commit 026cfcc

Browse files
author
Pat Patterson
committed
Merge pull request #14 from vnehess/master
add proxyUrl to getChatterFile
2 parents dbc3b1f + c212a32 commit 026cfcc

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

forcetk.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -195,17 +195,18 @@ if (forcetk.Client === undefined) {
195195
**/
196196
forcetk.Client.prototype.getChatterFile = function(path,mimeType,callback,error,retry) {
197197
var that = this;
198-
199198
var url = this.instanceUrl + path;
200199

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

207205
request.setRequestHeader(that.authzHeader, "OAuth " + that.sessionId);
208206
request.setRequestHeader('X-User-Agent', 'salesforce-toolkit-rest-javascript/' + that.apiVersion);
207+
if (this.proxyUrl !== null) {
208+
request.setRequestHeader('SalesforceProxy-Endpoint', url);
209+
}
209210

210211
request.onreadystatechange = function() {
211212
// continue if the process is completed

0 commit comments

Comments
 (0)