1
Fork 0
mirror of https://github.com/diced/zipline.git synced 2025-04-11 23:31:17 -05:00

fix: should fix ranged requests?

This commit is contained in:
diced 2025-01-22 23:00:48 -08:00
parent eb71c2bb54
commit b5f09673ac
No known key found for this signature in database
GPG key ID: 370BD1BA142842D1

View file

@ -26,7 +26,7 @@ function rawFileDecorator(fastify: FastifyInstance, _, done) {
.send();
if (rangeEnd === Infinity) rangeEnd = size - 1;
const data = await this.server.datasource.get(id, rangeStart, rangeEnd);
const data = await this.server.datasource.get(id, rangeStart, rangeEnd + 1);
// only send content-range if the client asked for it
if (this.request.headers.range) {
@ -46,6 +46,7 @@ function rawFileDecorator(fastify: FastifyInstance, _, done) {
)
if (size > this.server.config.core.compression.threshold && mimetype.match(/^(image|video|text)/))
return this.send(useCompress.call(this, data));
return this.send(data);
}
}