Skip to content
This repository was archived by the owner on Apr 8, 2026. It is now read-only.

Commit 51ffd23

Browse files
committed
fix(eocd): increase EOCD fetch range and improve error response details
1 parent 653d98d commit 51ffd23

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/controllers/GameController.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -497,12 +497,13 @@ export class Games {
497497
return res.status(404).send({ message: 'Download link not available' });
498498
}
499499

500-
// Fetch the last 22 bytes of the file (minimum EOCD size)
501-
const rangeHeader = 'bytes=-22';
500+
// Fetch the last 64KB of the file (maximum EOCD search window)
501+
const rangeHeader = 'bytes=-65536';
502502
const fileRes = await fetch(link, { headers: { Range: rangeHeader } });
503503

504504
if (!fileRes.ok) {
505-
return res.status(fileRes.status).send({ message: 'Error fetching EOCD' });
505+
const errorText = await fileRes.text();
506+
return res.status(fileRes.status).send({ message: 'Error fetching EOCD', status: fileRes.status, error: errorText });
506507
}
507508

508509
const buffer = await fileRes.arrayBuffer();

0 commit comments

Comments
 (0)