From b0dd0b8aef1d47065963a41a1717001b32bd74da Mon Sep 17 00:00:00 2001 From: Kedas Date: Fri, 30 Dec 2022 00:34:38 -0800 Subject: [PATCH] Fixes empty content type during upload (#9848) * Specify exact Content-Type for encrypted uploads * Add content type check for encrypted file upload * Fix code style issues --- src/ContentMessages.ts | 1 + test/ContentMessages-test.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/src/ContentMessages.ts b/src/ContentMessages.ts index f7e7b5277c..a2fe27d0a9 100644 --- a/src/ContentMessages.ts +++ b/src/ContentMessages.ts @@ -303,6 +303,7 @@ export async function uploadFile( progressHandler, abortController, includeFilename: false, + type: "application/octet-stream", }); if (abortController.signal.aborted) throw new UploadCanceledError(); diff --git a/test/ContentMessages-test.ts b/test/ContentMessages-test.ts index e2a4797791..5bfc9c315f 100644 --- a/test/ContentMessages-test.ts +++ b/test/ContentMessages-test.ts @@ -312,6 +312,7 @@ describe("uploadFile", () => { expect.objectContaining({ progressHandler, includeFilename: false, + type: "application/octet-stream", }), ); expect(mocked(client.uploadContent).mock.calls[0][0]).not.toBe(file);