fix(missions): only accept html mod lists for side op uploads
This commit is contained in:
parent
6fe7dd62bd
commit
fdf6da5c5b
1 changed files with 9 additions and 0 deletions
|
|
@ -205,6 +205,15 @@ export async function uploadSideOpModlist(
|
||||||
if (file.size > 10 * 1024 * 1024) {
|
if (file.size > 10 * 1024 * 1024) {
|
||||||
return { success: false, error: "Mod list file must be 10 MB or smaller." };
|
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 buffer = Buffer.from(await file.arrayBuffer());
|
||||||
const created = await payload.create({
|
const created = await payload.create({
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue