From c2ef0ae938779b3284fc875c7feed26317a410f0 Mon Sep 17 00:00:00 2001 From: Alan Grainger <16197738+alangrainger@users.noreply.github.com> Date: Mon, 1 Jun 2026 08:12:03 +0800 Subject: [PATCH] Fix #184 - return full video to clients that don't send Range header --- app/src/render.ts | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/app/src/render.ts b/app/src/render.ts index d4d894d..1c3ec2a 100644 --- a/app/src/render.ts +++ b/app/src/render.ts @@ -80,14 +80,20 @@ class Render { if (asset.type === AssetType.video) { subpath = '/video/playback' - // Stream videos in 2.5 MB chunks rather than the entire file - const range = (req.range || '').replace(/bytes=/, '').split('-') - const start = parseInt(range[0], 10) || 0 - const end = parseInt(range[1], 10) || start + 2499999 - fetchHeaders.range = `bytes=${start}-${end}` - headerList.push('cache-control', 'content-range') res.setHeader('accept-ranges', 'bytes') - res.status(206) // Partial Content + // Only chunk when the client sent a Range header. A browser