Open masx200 opened 3 years ago
https://github.com/koajs/koa-range/blob/3d18e9f18e450a48e6464f4497e8b619e7310e14/index.js#L80
if (len !== '*') {
ctx.length = end - start + 1;
}
Just make the following modifications.
if (len !== "*") {
let ctxlength = end - start + 1;
if (ctxlength <= 0) {
ctx.status = 416;
}
ctx.length = Math.max(0, ctxlength);
}
If the starting point of the range request is greater than the maximum length of the content, the response status 416 shall be returned.
I found that some video player clients will send out requests for video files beyond the scope. E.g. PotPlayer