diff --git a/app/crashReports.ts b/app/crashReports.ts index 3cb60bece074..ebd4898526c0 100644 --- a/app/crashReports.ts +++ b/app/crashReports.ts @@ -106,6 +106,7 @@ export function setup(getLogger: () => LoggerType): void { extension: 'dmp', contentType: 'application/octet-stream', compress: false, + prefix: 'desktop-crash-', }); logger.info('crashReports: upload complete'); diff --git a/ts/logging/uploadDebugLog.ts b/ts/logging/uploadDebugLog.ts index 9fac6020bff1..958b7e24283d 100644 --- a/ts/logging/uploadDebugLog.ts +++ b/ts/logging/uploadDebugLog.ts @@ -46,6 +46,7 @@ export type UploadOptionsType = Readonly<{ extension?: string; contentType?: string; compress?: boolean; + prefix?: string; }>; export const upload = async ({ @@ -55,10 +56,17 @@ export const upload = async ({ extension = 'gz', contentType = 'application/gzip', compress = true, + prefix, }: UploadOptionsType): Promise => { const headers = { 'User-Agent': getUserAgent(appVersion) }; - const signedForm = await got.get(BASE_URL, { + const formUrl = new URL(BASE_URL); + + if (prefix !== undefined) { + formUrl.searchParams.set('prefix', prefix); + } + + const signedForm = await got.get(formUrl.toString(), { responseType: 'json', headers, timeout: UPLOAD_TIMEOUT, diff --git a/ts/test-node/logging/uploadDebugLogs_test.ts b/ts/test-node/logging/uploadDebugLogs_test.ts index 592c4d3d7ea5..ff01d161ed6c 100644 --- a/ts/test-node/logging/uploadDebugLogs_test.ts +++ b/ts/test-node/logging/uploadDebugLogs_test.ts @@ -46,7 +46,7 @@ describe('upload', () => { ); sinon.assert.calledOnce(this.fakeGet); - sinon.assert.calledWith(this.fakeGet, 'https://debuglogs.org', { + sinon.assert.calledWith(this.fakeGet, 'https://debuglogs.org/', { responseType: 'json', headers: { 'User-Agent': 'Signal-Desktop/1.2.3 Linux' }, timeout: { request: durations.MINUTE },