Co-authored-by: Reifonas <211114984+Reifonas@users.noreply.github.com>
This commit is contained in:
gpt-engineer-app[bot]
2026-05-15 11:48:41 +00:00
parent acbb02cc94
commit 0b437bce8a
+1 -4
View File
@@ -45,18 +45,15 @@ const Index = () => {
}
if (ext === 'glb') {
// Para GLB, valida a assinatura antes de criar o objectURL
// Para GLB, valida assinatura "glTF" antes de criar o objectURL
try {
const head = await file.slice(0, 16).arrayBuffer();
const headBuf = new ArrayBuffer(file.size);
// Para validar assinatura precisamos só do header — slice já basta
const sigCheck = validateModelFile(file.name, file.size, ext, head);
if (!sigCheck.ok) {
toast.error(sigCheck.reason!);
if (sigCheck.detail) console.warn('[validateModelFile]', sigCheck.detail);
return;
}
void headBuf;
} catch (err) {
console.error('[upload] header read failed', err);
}