From ab68e24805294a7082ebb01aea821c53a4d54687 Mon Sep 17 00:00:00 2001 From: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com> Date: Thu, 1 Jun 2023 11:28:16 -0700 Subject: [PATCH] Optimize debug logs by truncating CDN URLs Attachments are end-to-end encrypted, and these lengthy URLs don't provide any meaningful info for debugging purposes. --- ts/textsecure/WebAPI.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ts/textsecure/WebAPI.ts b/ts/textsecure/WebAPI.ts index 26a2c3ab3409..d29662560f71 100644 --- a/ts/textsecure/WebAPI.ts +++ b/ts/textsecure/WebAPI.ts @@ -2534,6 +2534,12 @@ export function initialize({ type: 'POST', version, headers, + redactUrl: () => { + const tmp = new URL(signedUploadLocation); + tmp.search = ''; + tmp.pathname = ''; + return `${tmp}[REDACTED]`; + }, } );