Skip to content

Commit

Permalink
Merge pull request developerforce#14 from vnehess/master
Browse files Browse the repository at this point in the history
add proxyUrl to getChatterFile
  • Loading branch information
Pat Patterson committed Mar 7, 2012
2 parents dbc3b1f + c212a32 commit 026cfcc
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions forcetk.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,17 +195,18 @@ if (forcetk.Client === undefined) {
**/
forcetk.Client.prototype.getChatterFile = function(path,mimeType,callback,error,retry) {
var that = this;

var url = this.instanceUrl + path;

var request = new XMLHttpRequest();


request.open("GET", url, true);

request.open("GET", (this.proxyUrl !== null) ? this.proxyUrl: url, true);
request.responseType = "arraybuffer";

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

request.onreadystatechange = function() {
// continue if the process is completed
Expand Down

0 comments on commit 026cfcc

Please sign in to comment.