Skip to content

Commit b35768a

Browse files
author
Pat Patterson
committed
Added X-User-Agent header
1 parent 88946b3 commit b35768a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

forcetk.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ if (forcetk.Client === undefined) {
121121
*/
122122
forcetk.Client.prototype.setSessionToken = function(sessionId, apiVersion, instanceUrl) {
123123
this.sessionId = sessionId;
124-
this.apiVersion = (typeof apiVersion === 'undefined' || apiVersion == null)
124+
this.apiVersion = (typeof apiVersion === 'undefined' || apiVersion === null)
125125
? 'v21.0': apiVersion;
126126
if (typeof instanceUrl === 'undefined' || instanceUrl == null) {
127127
// location.hostname can be of the form 'abc.na1.visual.force.com' or
@@ -172,6 +172,7 @@ if (forcetk.Client === undefined) {
172172
xhr.setRequestHeader('SalesforceProxy-Endpoint', url);
173173
}
174174
xhr.setRequestHeader(that.authzHeader, "OAuth " + that.sessionId);
175+
xhr.setRequestHeader('X-User-Agent', 'salesforce-toolkit-rest-javascript/' + that.apiVersion);
175176
}
176177
});
177178
}

0 commit comments

Comments
 (0)