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

Commit 162fc7b

Browse files
committed
fix(download): handle missing range in download request by returning an empty zip file
1 parent c8293ca commit 162fc7b

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/controllers/GameController.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,12 @@ export class Games {
410410
const headers: any = {};
411411
if (req.headers.range) {
412412
headers.Range = req.headers.range;
413+
} else {
414+
// If no range is provided, return an empty zip file
415+
res.setHeader('Content-Disposition', `attachment; filename="${game.name}.zip"`);
416+
res.setHeader('Content-Type', 'application/zip');
417+
res.setHeader('Content-Length', '0');
418+
return res.status(200).end();
413419
}
414420

415421
const fileRes = await fetch(link, { headers });

0 commit comments

Comments
 (0)