1
0
Fork 0

fix(voiceover): remove upload mime allowlist and pin upload config in test

This commit is contained in:
Jason Fraley 2026-09-07 01:34:28 -04:00
parent 95887e56ce
commit a96b5de52b
2 changed files with 19 additions and 11 deletions

View file

@ -71,16 +71,11 @@ export const VoiceSubmissions: CollectionConfig = {
},
},
],
upload: {
mimeTypes: [
"audio/webm",
"audio/mpeg",
"audio/wav",
"audio/ogg",
"audio/mp4",
"audio/x-m4a",
"audio/m4a",
],
},
// No `upload.mimeTypes` allowlist on purpose: Payload content-sniffs uploads
// (file-type) and reports WebM recordings as `video/webm`, so an audio/* MIME
// allowlist rejects browser-recorded takes. The submit action is the gate
// instead (audio/* base type + size cap); restricted file types (executables,
// scripts, …) stay blocked by Payload's built-in checks.
upload: true,
timestamps: true,
};

View file

@ -0,0 +1,13 @@
import { describe, expect, it } from "vitest";
import { VoiceSubmissions } from "@/collections/voiceover/VoiceSubmissions";
describe("VoiceSubmissions upload config", () => {
// Regression guard: Payload content-sniffs uploads (file-type) and reports
// browser-recorded WebM takes as `video/webm`, so a MIME allowlist rejects
// every in-browser recording. The collection must accept any audio format;
// the submit server action is the audio/* gate instead.
it("accepts any standard audio format (no MIME allowlist)", () => {
expect(VoiceSubmissions.upload).toBe(true);
});
});