Skip to content

Commit

Permalink
Merge branch 'staging' into salt-checksum
Browse files Browse the repository at this point in the history
  • Loading branch information
turtledreams authored Jun 11, 2024
2 parents 00c5950 + 040d8d2 commit 0379319
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
! Minor breaking change ! For implementations using `salt` the browser compatability is tied to SubtleCrypto's `digest` method support

* Added the `salt` init config flag to add checksums to requests (for secure contexts only)
* Added support for Feedback Widgets' terms and conditions

## 23.12.6

Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/health_check.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe("Health Check tests ", () => {
// Test the 'hc' parameter
const hcParam = url.searchParams.get("hc");
const hcParamObj = JSON.parse(hcParam);
expect(hcParamObj).to.eql({ el: 0, wl: 0, sc: -1, em: "\"\"" });
expect(hcParamObj).to.eql({ el: 0, wl: 0, sc: -1, em: "" });

// Test the 'metrics' parameter
const metricsParam = url.searchParams.get("metrics");
Expand Down
11 changes: 8 additions & 3 deletions modules/CountlyClass.js
Original file line number Diff line number Diff line change
Expand Up @@ -3065,11 +3065,12 @@ class CountlyClass {
url += "&platform=" + this.platform;
url += "&app_version=" + this.app_version;
url += "&sdk_version=" + sdkVersion;
var customObjectToSendWithTheWidget = {};
customObjectToSendWithTheWidget.tc = 1; // indicates SDK supports opening links from the widget in a new tab
if (feedbackWidgetSegmentation) {
var customObjectToSendWithTheWidget = {};
customObjectToSendWithTheWidget.sg = feedbackWidgetSegmentation;
url += "&custom=" + JSON.stringify(customObjectToSendWithTheWidget);
}
url += "&custom=" + JSON.stringify(customObjectToSendWithTheWidget);
// Origin is passed to the popup so that it passes it back in the postMessage event
// Only web SDK passes origin and web
url += "&origin=" + passedOrigin;
Expand Down Expand Up @@ -4762,12 +4763,16 @@ class CountlyClass {
function sendInstantHCRequest() {
// truncate error message to 1000 characters
var curbedMessage = truncateSingleValue(self.hcErrorMessage, 1000, "healthCheck", log);
// due to some server issues we pass empty string as is
if (curbedMessage !== "") {
curbedMessage = JSON.stringify(curbedMessage);
}
// prepare hc object
var hc = {
el: self.hcErrorCount,
wl: self.hcWarningCount,
sc: self.hcStatusCode,
em: JSON.stringify(curbedMessage)
em: curbedMessage
};
// prepare request
var request = {
Expand Down

0 comments on commit 0379319

Please sign in to comment.