1
0
Fork 0

fix(missions): only accept html mod lists for side op uploads

This commit is contained in:
Jason Fraley 2026-09-09 18:55:00 -04:00
parent 6fe7dd62bd
commit fdf6da5c5b

View file

@ -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({