From fdf6da5c5bc08b1d2d2ce8a10842623efa6148d1 Mon Sep 17 00:00:00 2001 From: Z8MB1E Date: Wed, 9 Sep 2026 18:55:00 -0400 Subject: [PATCH] fix(missions): only accept html mod lists for side op uploads --- src/app/(frontend)/intelligence/missions/actions.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/app/(frontend)/intelligence/missions/actions.ts b/src/app/(frontend)/intelligence/missions/actions.ts index 07f31ae..4706cee 100644 --- a/src/app/(frontend)/intelligence/missions/actions.ts +++ b/src/app/(frontend)/intelligence/missions/actions.ts @@ -205,6 +205,15 @@ export async function uploadSideOpModlist( if (file.size > 10 * 1024 * 1024) { return { success: false, error: "Mod list file must be 10 MB or smaller." }; } + // Only HTML mod lists exported from the Arma 3 launcher are supported. Some + // browsers report an empty file.type, so also accept by extension. + const isHtml = file.type === "text/html" || /\.html?$/i.test(file.name); + if (!isHtml) { + return { + success: false, + error: "Mod list must be an HTML file exported from the Arma 3 launcher.", + }; + } const buffer = Buffer.from(await file.arrayBuffer()); const created = await payload.create({