Repair uploads and let the console follow any registered server
This commit is contained in:
1 parent
3e24d4a7bb
commit
683cdc4016
15 files changed
+193
-84
No files matched your search
@@ -40,7 +40,7 @@ export async function POST(req: NextRequest) {
|
||||
const isUpload = req.headers
|
||||
.get("content-type")
|
||||
?.includes("multipart/form-data");
|
||||
if (Number(req.headers.get("content-length") || 0) > 100 * 1024 * 1024)
|
||||
if (Number(req.headers.get("content-length") || 0) > 101 * 1024 * 1024)
|
||||
return fail("Upload limit is 100 MB");
|
||||
const form = isUpload ? await req.formData() : null;
|
||||
const body = form
|
||||
@@ -59,8 +59,8 @@ export async function POST(req: NextRequest) {
|
||||
return fail("Choose a file under 100 MB");
|
||||
const rel = path.relative(networkFilePath(p.id, ""), file);
|
||||
if (
|
||||
!/^(mods|plugins)\/[^/]+\.jar$/.test(rel) &&
|
||||
!/^world\/datapacks\/[^/]+\.zip$/.test(rel)
|
||||
!/^(mods|plugins)\/[^/]+\.jar$/i.test(rel) &&
|
||||
!/^world\/datapacks\/[^/]+\.zip$/i.test(rel)
|
||||
)
|
||||
return fail(
|
||||
"Upload JARs into mods/plugins or ZIPs into world/datapacks",
|
||||
|
||||
Reference in new issue
Block a user