refactor: update Docker base images, enhance image upload security, and implement shared form client logic and validation

This commit is contained in:
2026-08-01 15:57:55 +07:00 Unverified
parent e243a75d33
commit b557879928
14 changed files with 505 additions and 318 deletions
+3 -2
View File
@@ -20,12 +20,13 @@ export async function POST(req: Request) {
return NextResponse.json({ error: "No file provided" }, { status: 400 });
}
validateImageUploadFile(file);
const data = Buffer.from(await file.arrayBuffer());
validateImageUploadFile(file, data);
const [record] = await db
.insert(cdn)
.values({
data: Buffer.from(await file.arrayBuffer()),
data,
name: file.name || null,
type: file.type,
size: file.size,