Bundle-Magic-Bytes korrigiert (15 statt 11 Zeichen)
This commit is contained in:
1 parent
62ccfae38c
commit
c1dcff15fe
1 file changed
+1
-1
+1
-1
@@ -257,7 +257,7 @@ app.get('/api/download/:file', async (c) => {
|
||||
const buf = await asset.arrayBuffer();
|
||||
const head = new Uint8Array(buf.slice(0, 4));
|
||||
const isZip = head[0] === 0x50 && head[1] === 0x4b;
|
||||
const isBundle = new TextDecoder().decode(new Uint8Array(buf.slice(0, 11))) === '# v2 git b';
|
||||
const isBundle = new TextDecoder().decode(new Uint8Array(buf.slice(0, 15))) === '# v2 git bundle';
|
||||
if ((file === 'solus.zip' && !isZip) || (file === 'solus.bundle' && !isBundle)) {
|
||||
return c.json({ error: 'Artefakt beschädigt oder nicht im Build enthalten', file }, 404);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user