1
0
Fork 0
mirror of synced 2024-07-04 22:11:23 +12:00

Add a test for uppercase malicious extensions.

This commit is contained in:
Sam Rose 2023-11-21 10:42:44 +00:00
parent b4cb97963c
commit 79dcc468b8
No known key found for this signature in database

View file

@ -35,6 +35,17 @@ describe("/api/applications/:appId/sync", () => {
})
})
it("should reject an upload with a malicious uppercase file extension", async () => {
await config.withEnv({ SELF_HOSTED: undefined }, async () => {
let resp = (await config.api.attachment.process(
"OHNO.EXE",
Buffer.from([0]),
{ expectStatus: 400 }
)) as unknown as APIError
expect(resp.message).toContain("invalid extension")
})
})
it("should reject an upload with no file", async () => {
let resp = (await config.api.attachment.process(
undefined as any,