mirror of
https://github.com/Nezumi-2711/next-gdrive-index.git
synced 2026-09-22 13:38:38 +00:00
Update the range end to load 1MB at a time instead of requesting the whole file
This commit is contained in:
@@ -59,7 +59,9 @@ export async function GET(
|
||||
const rangeSize = ranges.match(rangeRegex);
|
||||
if (rangeSize) {
|
||||
rangeStart = parseInt(rangeSize[1], 10);
|
||||
rangeEnd = rangeSize ? parseInt(rangeSize[2], 10) : fileSize - 1;
|
||||
|
||||
const chunkSize = 1024 * 1024; // Load 1MB at a time
|
||||
rangeEnd = Math.min(rangeStart + chunkSize, fileSize - 1);
|
||||
}
|
||||
|
||||
const contentRange = `bytes=${rangeStart}-${Math.min(
|
||||
|
||||
Reference in New Issue
Block a user