Skip to content

Commit

Permalink
Add clientId header param to identify the extension in EventLogFile f…
Browse files Browse the repository at this point in the history
…eature 504
  • Loading branch information
tprouvot committed Nov 15, 2024
1 parent 451fe60 commit 833a3da
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Version 1.26

- Add [clientId](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/headers_calloptions.htm) header param to identify the extension in EventLogFile [feature 504](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/504)
- Add Apex Classes metadata search in Shortcut tab and new option configuration for the search [feature 591](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/591) request by [mpekacki](https://github.com/mpekacki)
- Add `My Personal Information` shortcuts [feature 627](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/627) request by [Alfredo Chissotti](https://github.com/Astisme)
- Add compatibility for force.com domain for Sf internal orgs
Expand Down
3 changes: 3 additions & 0 deletions addon/inspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export function nullToEmptyString(value) {
// For react input fields, the value may not be null or undefined, so this will clean the value
return (value == null) ? "" : value;
}
const clientId = "Salesforce Inspector Reloaded";

export let sfConn = {

Expand Down Expand Up @@ -54,6 +55,7 @@ export let sfConn = {
xhr.open(method, sfHost + url, true);

xhr.setRequestHeader("Accept", "application/json; charset=UTF-8");
xhr.setRequestHeader("Sforce-Call-Options", `client:${clientId}`);

if (api == "bulk") {
xhr.setRequestHeader("X-SFDC-Session", this.sessionId);
Expand Down Expand Up @@ -177,6 +179,7 @@ export let sfConn = {
xhr.open("POST", "https://" + this.instanceHostname + wsdl.servicePortAddress + "?cache=" + Math.random(), true);
xhr.setRequestHeader("Content-Type", "text/xml");
xhr.setRequestHeader("SOAPAction", '""');
xhr.setRequestHeader("CallOptions", `client:${clientId}`);

let sessionHeaderKey = wsdl.apiName == "Metadata" ? "met:SessionHeader" : "SessionHeader";
let sessionIdKey = wsdl.apiName == "Metadata" ? "met:sessionId" : "sessionId";
Expand Down

0 comments on commit 833a3da

Please sign in to comment.