@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/cjs/entry.js CHANGED
@@ -4744,7 +4744,7 @@ class App {
4744
4744
  this.stopCallbacks = [];
4745
4745
  this.commitCallbacks = [];
4746
4746
  this.activityState = ActivityState.NotActive;
4747
- this.version = '16.1.2'; // TODO: version compatability check inside each plugin.
4747
+ this.version = '16.1.3'; // TODO: version compatability check inside each plugin.
4748
4748
  this.socketMode = false;
4749
4749
  this.compressionThreshold = 24 * 1000;
4750
4750
  this.bc = null;
@@ -8111,14 +8111,20 @@ function filterBody(body) {
8111
8111
  return JSON.stringify(parsedBody);
8112
8112
  }
8113
8113
  else {
8114
- const params = new URLSearchParams(body);
8115
- for (const key of params.keys()) {
8116
- if (sensitiveParams.has(key.toLowerCase())) {
8117
- const value = obscure(params.get(key));
8118
- params.set(key, value);
8114
+ try {
8115
+ const params = new URLSearchParams(body);
8116
+ for (const key of params.keys()) {
8117
+ if (sensitiveParams.has(key.toLowerCase())) {
8118
+ const value = obscure(params.get(key));
8119
+ params.set(key, value);
8120
+ }
8119
8121
  }
8122
+ return params.toString();
8123
+ }
8124
+ catch (e) {
8125
+ // not string or url query
8126
+ return body;
8120
8127
  }
8121
- return params.toString();
8122
8128
  }
8123
8129
  }
8124
8130
  function sanitizeObject(obj) {
@@ -8519,9 +8525,10 @@ class ResponseProxyHandler {
8519
8525
  if (typeof this.resp.body.getReader !== 'function') {
8520
8526
  return;
8521
8527
  }
8522
- const _getReader = this.resp.body.getReader;
8528
+ const clonedResp = this.resp.clone();
8529
+ const _getReader = clonedResp.body.getReader;
8523
8530
  // @ts-ignore
8524
- this.resp.body.getReader = () => {
8531
+ clonedResp.body.getReader = () => {
8525
8532
  const reader = _getReader.apply(this.resp.body);
8526
8533
  // when readyState is already 4,
8527
8534
  // it's not a chunked stream, or it had already been read.
@@ -9363,7 +9370,7 @@ class API {
9363
9370
  this.signalStartIssue = (reason, missingApi) => {
9364
9371
  const doNotTrack = this.checkDoNotTrack();
9365
9372
  console.log("Tracker couldn't start due to:", JSON.stringify({
9366
- trackerVersion: '16.1.2',
9373
+ trackerVersion: '16.1.3',
9367
9374
  projectKey: this.options.projectKey,
9368
9375
  doNotTrack,
9369
9376
  reason: missingApi.length ? `missing api: ${missingApi.join(',')}` : reason,