@openreplay/tracker 16.1.2 → 16.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/lib/index.js CHANGED
@@ -4740,7 +4740,7 @@ class App {
4740
4740
  this.stopCallbacks = [];
4741
4741
  this.commitCallbacks = [];
4742
4742
  this.activityState = ActivityState.NotActive;
4743
- this.version = '16.1.2'; // TODO: version compatability check inside each plugin.
4743
+ this.version = '16.1.3'; // TODO: version compatability check inside each plugin.
4744
4744
  this.socketMode = false;
4745
4745
  this.compressionThreshold = 24 * 1000;
4746
4746
  this.bc = null;
@@ -8107,14 +8107,20 @@ function filterBody(body) {
8107
8107
  return JSON.stringify(parsedBody);
8108
8108
  }
8109
8109
  else {
8110
- const params = new URLSearchParams(body);
8111
- for (const key of params.keys()) {
8112
- if (sensitiveParams.has(key.toLowerCase())) {
8113
- const value = obscure(params.get(key));
8114
- params.set(key, value);
8110
+ try {
8111
+ const params = new URLSearchParams(body);
8112
+ for (const key of params.keys()) {
8113
+ if (sensitiveParams.has(key.toLowerCase())) {
8114
+ const value = obscure(params.get(key));
8115
+ params.set(key, value);
8116
+ }
8115
8117
  }
8118
+ return params.toString();
8119
+ }
8120
+ catch (e) {
8121
+ // not string or url query
8122
+ return body;
8116
8123
  }
8117
- return params.toString();
8118
8124
  }
8119
8125
  }
8120
8126
  function sanitizeObject(obj) {
@@ -8515,9 +8521,10 @@ class ResponseProxyHandler {
8515
8521
  if (typeof this.resp.body.getReader !== 'function') {
8516
8522
  return;
8517
8523
  }
8518
- const _getReader = this.resp.body.getReader;
8524
+ const clonedResp = this.resp.clone();
8525
+ const _getReader = clonedResp.body.getReader;
8519
8526
  // @ts-ignore
8520
- this.resp.body.getReader = () => {
8527
+ clonedResp.body.getReader = () => {
8521
8528
  const reader = _getReader.apply(this.resp.body);
8522
8529
  // when readyState is already 4,
8523
8530
  // it's not a chunked stream, or it had already been read.
@@ -9359,7 +9366,7 @@ class API {
9359
9366
  this.signalStartIssue = (reason, missingApi) => {
9360
9367
  const doNotTrack = this.checkDoNotTrack();
9361
9368
  console.log("Tracker couldn't start due to:", JSON.stringify({
9362
- trackerVersion: '16.1.2',
9369
+ trackerVersion: '16.1.3',
9363
9370
  projectKey: this.options.projectKey,
9364
9371
  doNotTrack,
9365
9372
  reason: missingApi.length ? `missing api: ${missingApi.join(',')}` : reason,