@actuallab/rpc 12.3.83 → 12.3.85

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/index.cjs CHANGED
@@ -2294,6 +2294,17 @@ var defaultConnectionUrlResolver = (peer) => {
2294
2294
  return peer.ref + sep + `clientId=${peer.clientId}&f=${formatKey}`;
2295
2295
  }
2296
2296
  };
2297
+ var sanitizeUrl = (url) => {
2298
+ try {
2299
+ const parsed = new URL(url);
2300
+ if (!parsed.searchParams.has("session"))
2301
+ return url;
2302
+ parsed.searchParams.set("session", "<redacted>");
2303
+ return parsed.toString();
2304
+ } catch {
2305
+ return url.replace(/([?&]session=)[^&]*/i, "$1<redacted>");
2306
+ }
2307
+ };
2297
2308
  function parseFormatFromUrl(url) {
2298
2309
  try {
2299
2310
  const f = new URL(url).searchParams.get("f");
@@ -2741,7 +2752,6 @@ var RpcClientPeer = class extends RpcPeer {
2741
2752
  }
2742
2753
  async _runImpl() {
2743
2754
  if (this._disposed) return;
2744
- const connUrl = this.connectionUrlResolver(this);
2745
2755
  infoLog?.log(`'${this.ref}': Started (Client)`);
2746
2756
  try {
2747
2757
  while (!this._disposed) {
@@ -2762,7 +2772,8 @@ var RpcClientPeer = class extends RpcPeer {
2762
2772
  let lastCloseCode = 0;
2763
2773
  let lastCloseReason = "";
2764
2774
  try {
2765
- infoLog?.log(`'${this.ref}': Connecting to ${connUrl}`);
2775
+ const connUrl = await this.connectionUrlResolver(this);
2776
+ infoLog?.log(`'${this.ref}': Connecting to ${sanitizeUrl(connUrl)}`);
2766
2777
  const ws = this.webSocketFactory?.(connUrl) ?? new WebSocket(connUrl);
2767
2778
  const conn = new RpcWebSocketConnection(
2768
2779
  ws,